Added @AutoConfigureTestDatabase to isolate each test suite's bootstrapped resources

Closes #49 (closed)

Merge request reports

Loading
+1 −1
Changes for src/test/java/org/etsi/osl/services/api/rcm634/ResourceSpecificationApiControllerTest.java: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -222,7 +222,7 @@ public class ResourceSpecificationApiControllerTest {
                .andReturn().getResponse().getContentAsString();

        List<LogicalResourceSpecification> listResSpecsResponse = JsonUtils.toListOfJsonObj(listResSpecsResponseString, LogicalResourceSpecification.class);
        assertEquals(7, listResSpecsResponse.size());
        assertEquals(9, listResSpecsResponse.size());

        mvc.perform(MockMvcRequestBuilders.get("/resourceCatalogManagement/v4/resourceSpecification")
                        .contentType(MediaType.APPLICATION_JSON)
+2 −0
Changes for src/test/java/org/etsi/osl/services/api/ri639/ResourceApiControllerTest.java: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,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;
@@ -48,6 +49,7 @@ import org.springframework.http.ResponseEntity;
@Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
@AutoConfigureMockMvc
@AutoConfigureTestDatabase
@ActiveProfiles("testing")

public class ResourceApiControllerTest {
+2 −0
Changes for src/test/java/org/etsi/osl/services/api/scm633/ServiceSpecificationApiControllerTest.java: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,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.HttpHeaders;
@@ -48,6 +49,7 @@ import org.springframework.web.context.WebApplicationContext;
@Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
@AutoConfigureMockMvc
@AutoConfigureTestDatabase
@ActiveProfiles("testing")
public class ServiceSpecificationApiControllerTest {

+2 −2
Changes for src/test/java/org/etsi/osl/services/api/ResourceCatalogIntegrationTest.java: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -106,11 +106,11 @@ public class ResourceCatalogIntegrationTest {

	private static final transient Log logger = LogFactory.getLog( ResourceCatalogIntegrationTest.class.getName());

	private static final int FIXED_BOOTSTRAPS_SPECS = 7;
	private static final int FIXED_BOOTSTRAPS_SPECS = 9;
	private static final int FIXED_BOOTSTRAPS_CATEGORIES = 3;
	private static final int FIXED_BOOTSTRAPS_PHYSICAL_SPECS = 1;
	private static final int FIXED_BOOTSTRAPS_NETWORK_SPECS = 3;
	private static final int FIXED_BOOTSTRAPS_LOGICAL_SPECS = 6;
	private static final int FIXED_BOOTSTRAPS_LOGICAL_SPECS = 8;
	
    @Autowired
    private MockMvc mvc;
+2 −1
Changes for src/test/java/org/etsi/osl/services/api/ResourceInventoryIntegrationTest.java: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -70,6 +70,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;
@@ -87,7 +88,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(
Loading
Loading