diff --git a/runtime-acm/pom.xml b/runtime-acm/pom.xml
index 7648175..c6729ff 100644
--- a/runtime-acm/pom.xml
+++ b/runtime-acm/pom.xml
@@ -50,6 +50,16 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>com.fasterxml.jackson.module</groupId>
+            <artifactId>jackson-module-jsonSchema</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>javax.validation</groupId>
+                    <artifactId>validation-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
             <exclusions>
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java
index e0027d3..726fcba 100644
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProvider.java
@@ -21,10 +21,11 @@
 
 package org.onap.policy.clamp.acm.runtime.commissioning;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializer;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -69,11 +70,11 @@
 
     private final ServiceTemplateProvider serviceTemplateProvider;
     private final AutomationCompositionProvider acProvider;
+    private final ObjectMapper mapper = new ObjectMapper();
     private final ParticipantProvider participantProvider;
     private final SupervisionHandler supervisionHandler;
 
-    private static final Map<String, String> sections = new HashMap<>();
-    private Gson gson = new Gson();
+    private static final Map<String, JavaType> sections = new HashMap<>();
 
     /**
      * Create a commissioning provider.
@@ -84,12 +85,13 @@
      * @param participantProvider the Participant Provider
      */
     public CommissioningProvider(ServiceTemplateProvider serviceTemplateProvider,
-        AutomationCompositionProvider acProvider, SupervisionHandler supervisionHandler,
-        ParticipantProvider participantProvider) {
+            AutomationCompositionProvider acProvider, SupervisionHandler supervisionHandler,
+            ParticipantProvider participantProvider) {
         this.serviceTemplateProvider = serviceTemplateProvider;
         this.acProvider = acProvider;
         this.supervisionHandler = supervisionHandler;
         this.participantProvider = participantProvider;
+        mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
     }
 
     /**
@@ -98,34 +100,15 @@
      */
     @EventListener(ApplicationReadyEvent.class)
     public void initialize() {
-        GsonBuilder builder = new GsonBuilder();
-        builder.registerTypeAdapter(ToscaServiceTemplate.class,
-                (JsonSerializer<ToscaServiceTemplate>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaDataType.class,
-                (JsonSerializer<ToscaDataType>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaCapabilityType.class,
-                (JsonSerializer<ToscaCapabilityType>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaNodeType.class,
-                (JsonSerializer<ToscaNodeType>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaRelationshipType.class,
-                (JsonSerializer<ToscaRelationshipType>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaPolicyType.class,
-                (JsonSerializer<ToscaPolicyType>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaTopologyTemplate.class,
-                (JsonSerializer<ToscaTopologyTemplate>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.registerTypeAdapter(ToscaNodeTemplate.class,
-                (JsonSerializer<ToscaNodeTemplate>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.setPrettyPrinting();
-        gson = builder.create();
-
-        sections.put("data_types", gson.toJson(new ToscaDataType()));
-        sections.put("capability_types", gson.toJson(new ToscaCapabilityType()));
-        sections.put("node_types", gson.toJson(new ToscaNodeType()));
-        sections.put("relationship_types", gson.toJson(new ToscaRelationshipType()));
-        sections.put("policy_types", gson.toJson(new ToscaPolicyType()));
-        sections.put("topology_template", gson.toJson(new ToscaTopologyTemplate()));
-        sections.put("node_templates", gson.toJson(new ToscaNodeTemplate()));
-        sections.put("all", gson.toJson(new ToscaServiceTemplate()));
+        sections.put("data_types", mapper.constructType(ToscaDataType.class));
+        sections.put("capability_types", mapper.constructType(ToscaCapabilityType.class));
+        sections.put("node_types", mapper.constructType(ToscaNodeType.class));
+        sections.put("relationship_types", mapper.constructType(ToscaRelationshipType.class));
+        sections.put("policy_types", mapper.constructType(ToscaPolicyType.class));
+        sections.put("topology_template", mapper.constructType(ToscaTopologyTemplate.class));
+        sections.put("node_templates",
+                mapper.getTypeFactory().constructCollectionType(List.class, ToscaNodeTemplate.class));
+        sections.put("all", mapper.constructType(ToscaServiceTemplate.class));
     }
 
     /**
@@ -136,11 +119,11 @@
      * @throws PfModelException on creation errors
      */
     public CommissioningResponse createAutomationCompositionDefinitions(ToscaServiceTemplate serviceTemplate)
-        throws PfModelException {
+            throws PfModelException {
 
         if (verifyIfInstancePropertiesExists()) {
             throw new PfModelException(Status.BAD_REQUEST,
-                "Delete instances, to commission automation composition definitions");
+                    "Delete instances, to commission automation composition definitions");
         }
         serviceTemplate = serviceTemplateProvider.createServiceTemplate(serviceTemplate);
         List<Participant> participantList = participantProvider.getParticipants();
@@ -169,11 +152,11 @@
      * @throws PfModelException on deletion errors
      */
     public CommissioningResponse deleteAutomationCompositionDefinition(String name, String version)
-        throws PfModelException {
+            throws PfModelException {
 
         if (verifyIfInstancePropertiesExists()) {
             throw new PfModelException(Status.BAD_REQUEST,
-                "Delete instances, to commission automation composition definitions");
+                    "Delete instances, to commission automation composition definitions");
         }
         List<Participant> participantList = participantProvider.getParticipants();
         if (!participantList.isEmpty()) {
@@ -196,7 +179,7 @@
      */
     @Transactional(readOnly = true)
     public List<ToscaNodeTemplate> getAutomationCompositionDefinitions(String acName, String acVersion)
-        throws PfModelException {
+            throws PfModelException {
 
         // @formatter:off
         ToscaTypedEntityFilter<ToscaNodeTemplate> nodeTemplateFilter = ToscaTypedEntityFilter
@@ -219,7 +202,7 @@
      */
     @Transactional(readOnly = true)
     public List<ToscaNodeTemplate> getAutomationCompositionElementDefinitions(
-        ToscaNodeTemplate automationCompositionNodeTemplate) throws PfModelException {
+            ToscaNodeTemplate automationCompositionNodeTemplate) throws PfModelException {
         if (!AUTOMATION_COMPOSITION_NODE_TYPE.equals(automationCompositionNodeTemplate.getType())) {
             return Collections.emptyList();
         }
@@ -230,7 +213,7 @@
 
         @SuppressWarnings("unchecked")
         List<Map<String, String>> automationCompositionElements =
-            (List<Map<String, String>>) automationCompositionNodeTemplate.getProperties().get("elements");
+                (List<Map<String, String>>) automationCompositionNodeTemplate.getProperties().get("elements");
 
         if (CollectionUtils.isEmpty(automationCompositionElements)) {
             return Collections.emptyList();
@@ -262,23 +245,23 @@
      */
     @Transactional(readOnly = true)
     public Map<String, ToscaNodeTemplate> getNodeTemplatesWithCommonOrInstanceProperties(boolean common, String name,
-        String version) throws PfModelException {
+            String version) throws PfModelException {
 
         if (common && verifyIfInstancePropertiesExists()) {
             throw new PfModelException(Status.BAD_REQUEST,
-                "Cannot create or edit common properties, delete all the instantiations first");
+                    "Cannot create or edit common properties, delete all the instantiations first");
         }
 
         var serviceTemplateList = serviceTemplateProvider.getServiceTemplateList(name, version);
         var commonOrInstanceNodeTypeProps =
-            serviceTemplateProvider.getCommonOrInstancePropertiesFromNodeTypes(common, serviceTemplateList.get(0));
+                serviceTemplateProvider.getCommonOrInstancePropertiesFromNodeTypes(common, serviceTemplateList.get(0));
 
         var serviceTemplates = new ToscaServiceTemplates();
         serviceTemplates.setServiceTemplates(filterToscaNodeTemplateInstance(serviceTemplateList));
 
         return serviceTemplateProvider.getDerivedCommonOrInstanceNodeTemplates(
-            serviceTemplates.getServiceTemplates().get(0).getToscaTopologyTemplate().getNodeTemplates(),
-            commonOrInstanceNodeTypeProps);
+                serviceTemplates.getServiceTemplates().get(0).getToscaTopologyTemplate().getNodeTemplates(),
+                commonOrInstanceNodeTypeProps);
     }
 
     /**
@@ -332,7 +315,12 @@
         template.put("node_types", fullTemplate.getNodeTypes());
         template.put("topology_template", fullTemplate.getToscaTopologyTemplate());
 
-        return gson.toJson(template);
+        try {
+            return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(template);
+
+        } catch (JsonProcessingException e) {
+            throw new PfModelException(Status.BAD_REQUEST, "Converion to Json Schema failed", e);
+        }
     }
 
     /**
@@ -343,7 +331,15 @@
      * @throws PfModelException on errors with retrieving the classes
      */
     public String getToscaServiceTemplateSchema(String section) throws PfModelException {
-        return sections.getOrDefault(section, sections.get("all"));
+        var visitor = new SchemaFactoryWrapper();
+        var sectionMapper = sections.getOrDefault(section, sections.get("all"));
+        try {
+            mapper.acceptJsonFormatVisitor(sectionMapper, visitor);
+            var jsonSchema = visitor.finalSchema();
+            return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema);
+        } catch (JsonProcessingException e) {
+            throw new PfModelException(Status.BAD_REQUEST, "Converion to Json Schema failed", e);
+        }
     }
 
     private List<ToscaServiceTemplate> filterToscaNodeTemplateInstance(List<ToscaServiceTemplate> serviceTemplates) {
@@ -376,7 +372,7 @@
      */
     private boolean verifyIfInstancePropertiesExists() {
         return acProvider.getAllNodeTemplates().stream()
-            .anyMatch(nodeTemplate -> nodeTemplate.getKey().getName().contains(HYPHEN));
+                .anyMatch(nodeTemplate -> nodeTemplate.getKey().getName().contains(HYPHEN));
 
     }
 }
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java
index bcdb4dd..71aadcc 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/CommissioningProviderTest.java
@@ -29,10 +29,9 @@
 import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_SERVICE_TEMPLATE_YAML;
 import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_ST_TEMPLATE_YAML;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyNamingStrategies;
+import com.fasterxml.jackson.module.jsonSchema.factories.SchemaFactoryWrapper;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -56,6 +55,7 @@
 class CommissioningProviderTest {
 
     private static final Coder CODER = new StandardCoder();
+    private final ObjectMapper mapper = new ObjectMapper();
 
     /**
      * Test the fetching of automation composition definitions (ToscaServiceTemplates).
@@ -69,13 +69,13 @@
         var serviceTemplateProvider = mock(ServiceTemplateProvider.class);
 
         CommissioningProvider provider =
-            new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
+                new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
 
         List<ToscaNodeTemplate> listOfTemplates = provider.getAutomationCompositionDefinitions(null, null);
         assertThat(listOfTemplates).isEmpty();
 
         when(acProvider.getFilteredNodeTemplates(any()))
-            .thenReturn(List.of(new ToscaNodeTemplate(), new ToscaNodeTemplate()));
+                .thenReturn(List.of(new ToscaNodeTemplate(), new ToscaNodeTemplate()));
         listOfTemplates = provider.getAutomationCompositionDefinitions(null, null);
         assertThat(listOfTemplates).hasSize(2);
     }
@@ -92,7 +92,7 @@
         var participantProvider = mock(ParticipantProvider.class);
 
         CommissioningProvider provider =
-            new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
+                new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
 
         List<ToscaNodeTemplate> listOfTemplates = provider.getAutomationCompositionDefinitions(null, null);
         assertThat(listOfTemplates).isEmpty();
@@ -102,11 +102,11 @@
 
         // Response should return the number of node templates present in the service template
         List<ToscaConceptIdentifier> affectedDefinitions = provider
-            .createAutomationCompositionDefinitions(serviceTemplate).getAffectedAutomationCompositionDefinitions();
+                .createAutomationCompositionDefinitions(serviceTemplate).getAffectedAutomationCompositionDefinitions();
         assertThat(affectedDefinitions).hasSize(13);
 
         when(acProvider.getFilteredNodeTemplates(any()))
-            .thenReturn(List.of(new ToscaNodeTemplate(), new ToscaNodeTemplate()));
+                .thenReturn(List.of(new ToscaNodeTemplate(), new ToscaNodeTemplate()));
 
         listOfTemplates = provider.getAutomationCompositionDefinitions(null, null);
         assertThat(listOfTemplates).hasSize(2);
@@ -124,9 +124,8 @@
         var participantProvider = mock(ParticipantProvider.class);
 
         CommissioningProvider provider =
-            new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
-        ToscaServiceTemplate serviceTemplate =
-            InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
+                new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
+        ToscaServiceTemplate serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
         when(serviceTemplateProvider.createServiceTemplate(serviceTemplate)).thenReturn(serviceTemplate);
 
         provider.createAutomationCompositionDefinitions(serviceTemplate);
@@ -138,7 +137,7 @@
         assertThat(returnedServiceTemplate).isNotNull();
 
         Map<String, ToscaNodeTemplate> nodeTemplates =
-            returnedServiceTemplate.getToscaTopologyTemplate().getNodeTemplates();
+                returnedServiceTemplate.getToscaTopologyTemplate().getNodeTemplates();
 
         assertThat(nodeTemplates).hasSize(8);
     }
@@ -155,15 +154,14 @@
         var participantProvider = mock(ParticipantProvider.class);
 
         CommissioningProvider provider =
-            new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
-        ToscaServiceTemplate serviceTemplate =
-            InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
+                new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
+        ToscaServiceTemplate serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
         when(serviceTemplateProvider.createServiceTemplate(serviceTemplate)).thenReturn(serviceTemplate);
 
         provider.createAutomationCompositionDefinitions(serviceTemplate);
 
-        when(serviceTemplateProvider.getServiceTemplateList(any(), any())).thenReturn(List.of(
-            Objects.requireNonNull(serviceTemplate)));
+        when(serviceTemplateProvider.getServiceTemplateList(any(), any()))
+                .thenReturn(List.of(Objects.requireNonNull(serviceTemplate)));
 
         String returnedServiceTemplate = provider.getToscaServiceTemplateReduced(null, null);
         assertThat(returnedServiceTemplate).isNotNull();
@@ -185,36 +183,36 @@
         var participantProvider = mock(ParticipantProvider.class);
 
         CommissioningProvider provider =
-            new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
-        ToscaServiceTemplate serviceTemplate =
-            InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
+                new CommissioningProvider(serviceTemplateProvider, acProvider, null, participantProvider);
+        ToscaServiceTemplate serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
         when(serviceTemplateProvider.createServiceTemplate(serviceTemplate)).thenReturn(serviceTemplate);
 
         provider.createAutomationCompositionDefinitions(serviceTemplate);
         provider.initialize();
 
-        final Map<String, Class<?>> sections = Map.of("all", ToscaServiceTemplate.class,
-            "data_types", ToscaDataType.class, "capability_types", ToscaCapabilityType.class,
-            "node_types", ToscaNodeType.class, "relationship_types",
-            ToscaRelationshipType.class, "policy_types", ToscaPolicyType.class, "topology_template",
-            ToscaTopologyTemplate.class, "node_templates", List.class);
+        mapper.setPropertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
 
-        String localServiceTemplateSchema = new String();
-        Gson gson = new Gson();
-        GsonBuilder builder = new GsonBuilder();
-        builder.registerTypeAdapter(ToscaTopologyTemplate.class,
-                (JsonSerializer<ToscaTopologyTemplate>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.setPrettyPrinting();
-        gson = builder.create();
+        Map<String, Class<?>> sections = Map.of("all", ToscaServiceTemplate.class, "data_types", ToscaDataType.class,
+                "capability_types", ToscaCapabilityType.class, "node_types", ToscaNodeType.class, "relationship_types",
+                ToscaRelationshipType.class, "policy_types", ToscaPolicyType.class, "topology_template",
+                ToscaTopologyTemplate.class, "node_templates", List.class);
 
         for (Map.Entry<String, Class<?>> entry : sections.entrySet()) {
             String returnedServiceTemplateSchema = provider.getToscaServiceTemplateSchema(entry.getKey());
             assertThat(returnedServiceTemplateSchema).isNotNull();
 
-            if (entry.getKey().equals("topology_template")) {
-                localServiceTemplateSchema = gson.toJson(new ToscaTopologyTemplate());
-                assertThat(localServiceTemplateSchema).isEqualTo(returnedServiceTemplateSchema);
+            var visitor = new SchemaFactoryWrapper();
+
+            if (entry.getKey().equals("node_templates")) {
+                mapper.acceptJsonFormatVisitor(
+                        mapper.getTypeFactory().constructCollectionType(List.class, ToscaNodeTemplate.class), visitor);
+            } else {
+                mapper.acceptJsonFormatVisitor(mapper.constructType(entry.getValue()), visitor);
             }
+
+            var jsonSchema = visitor.finalSchema();
+            String localServiceTemplateSchema = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonSchema);
+            assertThat(localServiceTemplateSchema).isEqualTo(returnedServiceTemplateSchema);
         }
     }
 }
diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java
index f9a7b20..87633df 100644
--- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java
+++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/commissioning/rest/CommissioningControllerTest.java
@@ -29,12 +29,6 @@
 import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_SERVICE_TEMPLATE_YAML;
 import static org.onap.policy.clamp.acm.runtime.util.CommonTestData.TOSCA_ST_TEMPLATE_YAML;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
-import com.google.gson.JsonPrimitive;
-import com.google.gson.JsonSerializer;
 import java.util.List;
 import java.util.Map;
 import javax.ws.rs.client.Entity;
@@ -82,8 +76,7 @@
     @BeforeAll
     public static void setUpBeforeClass() {
         serviceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_SERVICE_TEMPLATE_YAML);
-        commonPropertiesServiceTemplate =
-            InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
+        commonPropertiesServiceTemplate = InstantiationUtils.getToscaServiceTemplate(TOSCA_ST_TEMPLATE_YAML);
     }
 
     @BeforeEach
@@ -143,18 +136,9 @@
         Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT + "/toscaservicetemplate");
         Response rawresp = invocationBuilder.buildGet().invoke();
         assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
-        String template = rawresp.readEntity(String.class);
-        final JsonObject jsonObject = new JsonParser().parse(template).getAsJsonObject();
-
-        Gson gson = new Gson();
-        GsonBuilder builder = new GsonBuilder();
-        builder.registerTypeAdapter(ToscaNodeTemplate.class,
-                (JsonSerializer<ToscaNodeTemplate>) (src, typeOfSrc, context) -> new JsonPrimitive(src.toString()));
-        builder.setPrettyPrinting();
-        gson = builder.create();
-
-        ToscaNodeTemplate toscaNodeTemplate = gson.fromJson(jsonObject, ToscaNodeTemplate.class);
-        assertNotNull(toscaNodeTemplate);
+        ToscaServiceTemplate template = rawresp.readEntity(ToscaServiceTemplate.class);
+        assertNotNull(template);
+        assertThat(template.getNodeTypes()).hasSize(7);
     }
 
     @Test
@@ -162,7 +146,7 @@
         createFullEntryInDbWithCommonProps();
 
         Invocation.Builder invocationBuilder =
-            super.sendRequest(COMMISSIONING_ENDPOINT + "/toscaServiceTemplateSchema");
+                super.sendRequest(COMMISSIONING_ENDPOINT + "/toscaServiceTemplateSchema");
         Response rawresp = invocationBuilder.buildGet().invoke();
         assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
         String schema = rawresp.readEntity(String.class);
@@ -174,7 +158,7 @@
         createFullEntryInDbWithCommonProps();
 
         Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT
-            + "/getCommonOrInstanceProperties" + "?common=true&name=ToscaServiceTemplateSimple&version=1.0.0");
+                + "/getCommonOrInstanceProperties" + "?common=true&name=ToscaServiceTemplateSimple&version=1.0.0");
         Response rawresp = invocationBuilder.buildGet().invoke();
         assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
 
@@ -209,7 +193,7 @@
         assertThat(commissioningResponse.getAffectedAutomationCompositionDefinitions()).hasSize(13);
         for (String nodeTemplateName : serviceTemplate.getToscaTopologyTemplate().getNodeTemplates().keySet()) {
             assertTrue(commissioningResponse.getAffectedAutomationCompositionDefinitions().stream()
-                .anyMatch(ac -> ac.getName().equals(nodeTemplateName)));
+                    .anyMatch(ac -> ac.getName().equals(nodeTemplateName)));
         }
     }
 
@@ -250,8 +234,8 @@
     void testQueryElements() throws Exception {
         createEntryInDB();
 
-        Invocation.Builder invocationBuilder = super.sendRequest(
-            COMMISSIONING_ENDPOINT + "/elements" + "?name=org.onap.domain.pmsh.PMSHAutomationCompositionDefinition");
+        Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT + "/elements"
+                + "?name=org.onap.domain.pmsh.PMSHAutomationCompositionDefinition");
         Response rawresp = invocationBuilder.buildGet().invoke();
         assertEquals(Response.Status.OK.getStatusCode(), rawresp.getStatus());
         List<?> entityList = rawresp.readEntity(List.class);
@@ -274,7 +258,7 @@
         var serviceTemplateCreated = createEntryInDB();
 
         Invocation.Builder invocationBuilder = super.sendRequest(COMMISSIONING_ENDPOINT + "?name="
-            + serviceTemplateCreated.getName() + "&version=" + serviceTemplateCreated.getVersion());
+                + serviceTemplateCreated.getName() + "&version=" + serviceTemplateCreated.getVersion());
         // Call delete with no info
         Response resp = invocationBuilder.delete();
         assertEquals(Response.Status.OK.getStatusCode(), resp.getStatus());
