diff --git a/pom.xml b/pom.xml index 681a724a36ed1e96906dd64ec3512bedb27282e4..885c3062d39c252078cdaf8636c69305ec312f2a 100644 --- a/pom.xml +++ b/pom.xml @@ -261,6 +261,13 @@ org.springframework.boot spring-boot-starter-test test + + + com.vaadin.external.google + android-json + + + org.springframework.security diff --git a/src/test/java/org/etsi/osl/services/api/ResourceCatalogIntegrationTest.java b/src/test/java/org/etsi/osl/services/api/ResourceCatalogIntegrationTest.java index 926f88a057a13ce54fea11eea9a5825f2b57029e..02aa8e095c94224861e518136431600a89d9f4c9 100644 --- a/src/test/java/org/etsi/osl/services/api/ResourceCatalogIntegrationTest.java +++ b/src/test/java/org/etsi/osl/services/api/ResourceCatalogIntegrationTest.java @@ -76,6 +76,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; @@ -95,7 +96,7 @@ import net.minidev.json.JSONObject; @RunWith(SpringRunner.class) @Transactional @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) -//@AutoConfigureTestDatabase //this automatically uses h2 +@AutoConfigureTestDatabase //this automatically uses h2 @AutoConfigureMockMvc @ActiveProfiles("testing") //@TestPropertySource( diff --git a/src/test/java/org/etsi/osl/services/api/ServiceInventoryIntegrationTest.java b/src/test/java/org/etsi/osl/services/api/ServiceInventoryIntegrationTest.java index d31dd72da06a1f5aa54e6b05338769738e96b750..16ad168abce52debb68d788ab7467a9a0ea096dd 100644 --- a/src/test/java/org/etsi/osl/services/api/ServiceInventoryIntegrationTest.java +++ b/src/test/java/org/etsi/osl/services/api/ServiceInventoryIntegrationTest.java @@ -66,6 +66,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; @@ -83,7 +84,7 @@ import org.springframework.web.context.WebApplicationContext; @RunWith(SpringRunner.class) @Transactional @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) -//@AutoConfigureTestDatabase //this automatically uses h2 +@AutoConfigureTestDatabase //this automatically uses h2 @AutoConfigureMockMvc @ActiveProfiles("testing") //@TestPropertySource( diff --git a/src/test/java/org/etsi/osl/services/api/sim638/ServiceApiControllerTest.java b/src/test/java/org/etsi/osl/services/api/sim638/ServiceApiControllerTest.java index afdebd6bb882254a887e80a128320525e5ab71f6..5c59431d0b5ac8e2852034a9cf4afb292078ac99 100644 --- a/src/test/java/org/etsi/osl/services/api/sim638/ServiceApiControllerTest.java +++ b/src/test/java/org/etsi/osl/services/api/sim638/ServiceApiControllerTest.java @@ -17,6 +17,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.HttpStatus; @@ -51,7 +52,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @RunWith(SpringRunner.class) @Transactional @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) -//@AutoConfigureTestDatabase //this automatically uses h2 +@AutoConfigureTestDatabase //this automatically uses h2 @AutoConfigureMockMvc @ActiveProfiles("testing") //@TestPropertySource( diff --git a/src/test/java/org/etsi/osl/services/reposervices/scm633/ServiceSpecificationRepoServiceTest.java b/src/test/java/org/etsi/osl/services/reposervices/scm633/ServiceSpecificationRepoServiceTest.java index a3ea0b35041c947db4a420d0460150cbeadca245..c5e308251e6bfdef4a532431393d966cc46d86fa 100644 --- a/src/test/java/org/etsi/osl/services/reposervices/scm633/ServiceSpecificationRepoServiceTest.java +++ b/src/test/java/org/etsi/osl/services/reposervices/scm633/ServiceSpecificationRepoServiceTest.java @@ -446,7 +446,8 @@ public class ServiceSpecificationRepoServiceTest { alias = v.getAlias(); assertEquals("PrimitivesList", serviceSpecCharacteristic.getName()); - assertEquals("{\"vnfs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf1\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf2\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]}]}", value); +// assertEquals("{\"vnfs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf1\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vnf2\",\"vdu-configs\":[{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}],\"name\":\"run-touch-command\"}],\"id\":\"vdu2\"}]}]}", value); + assertEquals("{\"vnfs\":[{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vnf1\",\"vdu-configs\":[{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu2\"}]},{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vnf2\",\"vdu-configs\":[{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu1\"},{\"config-primitive\":[{\"name\":\"run-touch-command\",\"parameter\":[{\"name\":\"filename\",\"data-type\":\"STRING\"}]}],\"id\":\"vdu2\"}]}]}", value); assertEquals("", alias);