@Override
   public List<Service> getServiceDefinitions() throws MockRepositoryImportException {
      List<Service> result = new ArrayList<>();

      // Build a new service.
      Service service = new Service();
      service.setName(rootSpecification.path("info").path("title").asText());
      service.setVersion(rootSpecification.path("info").path("version").asText());
      service.setType(ServiceType.REST);

      // Complete metadata if specified via extension.
      if (rootSpecification.path("info").has(MetadataExtensions.MICROCKS_EXTENSION)) {
         Metadata metadata = new Metadata();
         MetadataExtractor.completeMetadata(metadata,
               rootSpecification.path("info").path(MetadataExtensions.MICROCKS_EXTENSION));
         service.setMetadata(metadata);
      }

      // Before extraction operations, we need to get and build external reference if we have a resolver.
      initializeReferencedResources(service);

      // Then build its operations.
      service.setOperations(extractOperations());

      result.add(service);
      return result;
   }
@Test
   void testQueryParameterRefsOpenAPIImport() {
      OpenAPIImporter importer = null;
      try {
         importer = new OpenAPIImporter(
               "target/test-classes/io/github/microcks/util/openapi/query-param-refs-openapi.yaml", null);
      } catch (IOException ioe) {
         fail("Exception should not be thrown");
      }

      // Check that basic service properties are there.
      List<Service> services = null;
      try {
         services = importer.getServiceDefinitions();
      } catch (MockRepositoryImportException e) {
         fail("Exception should not be thrown");
      }
      assertEquals(1, services.size());
      Service service = services.get(0);
      assertEquals("API-Template", service.getName());
      Assertions.assertEquals(ServiceType.REST, service.getType());
      assertEquals("1.0.0", service.getVersion());

      // Check that operations and input/output have been found.
      assertEquals(2, service.getOperations().size());

      for (Operation operation : service.getOperations()) {

         if ("GET /accounts".equals(operation.getName())) {
            assertEquals("GET", operation.getMethod());
            assertEquals(DispatchStyles.URI_PARAMS, operation.getDispatcher());
            assertEquals("level", operation.getDispatcherRules());
         } else if ("GET /resources".equals(operation.getName())) {
            assertEquals(DispatchStyles.URI_PARAMS, operation.getDispatcher());
            assertEquals("resourceType", operation.getDispatcherRules());
         } else {
            fail("Unknown operation name: " + operation.getName());
         }
      }
   }