Skip to content
Snippets Groups Projects
Commit 427dc1e8 authored by tranoris's avatar tranoris Committed by Nikolaos Kyriakoulis
Browse files

fix for #49

parent 2240d16e
No related branches found
No related tags found
1 merge request!46Implemented pm628 API
...@@ -437,6 +437,10 @@ ...@@ -437,6 +437,10 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version> <version>3.2.5</version>
<configuration>
<!-- Disable parallel execution -->
<parallel>none</parallel>
</configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
...@@ -458,11 +462,6 @@ ...@@ -458,11 +462,6 @@
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
......
...@@ -17,6 +17,7 @@ import org.junit.Before; ...@@ -17,6 +17,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -36,6 +37,7 @@ import org.springframework.web.context.WebApplicationContext; ...@@ -36,6 +37,7 @@ import org.springframework.web.context.WebApplicationContext;
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
@AutoConfigureMockMvc @AutoConfigureMockMvc
@ActiveProfiles("testing") @ActiveProfiles("testing")
@AutoConfigureTestDatabase //this automatically uses h2
public class HubApiControllerTest { public class HubApiControllerTest {
@Autowired @Autowired
......
...@@ -25,6 +25,7 @@ import org.junit.Before; ...@@ -25,6 +25,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -43,6 +44,7 @@ import org.springframework.web.context.WebApplicationContext; ...@@ -43,6 +44,7 @@ import org.springframework.web.context.WebApplicationContext;
@Transactional @Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
@AutoConfigureMockMvc @AutoConfigureMockMvc
@AutoConfigureTestDatabase //this automatically uses h2
@ActiveProfiles("testing") @ActiveProfiles("testing")
public class ServiceCandidateApiControllerTest { public class ServiceCandidateApiControllerTest {
......
...@@ -25,6 +25,7 @@ import org.junit.Before; ...@@ -25,6 +25,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -43,6 +44,7 @@ import org.springframework.web.context.WebApplicationContext; ...@@ -43,6 +44,7 @@ import org.springframework.web.context.WebApplicationContext;
@Transactional @Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
@AutoConfigureMockMvc @AutoConfigureMockMvc
@AutoConfigureTestDatabase //this automatically uses h2
@ActiveProfiles("testing") @ActiveProfiles("testing")
public class ServiceCatalogApiControllerTest { public class ServiceCatalogApiControllerTest {
......
...@@ -16,6 +16,7 @@ import org.junit.Before; ...@@ -16,6 +16,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -34,6 +35,7 @@ import org.springframework.web.context.WebApplicationContext; ...@@ -34,6 +35,7 @@ import org.springframework.web.context.WebApplicationContext;
@Transactional @Transactional
@SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class) @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.MOCK , classes = OpenAPISpringBoot.class)
@AutoConfigureMockMvc @AutoConfigureMockMvc
@AutoConfigureTestDatabase //this automatically uses h2
@ActiveProfiles("testing") @ActiveProfiles("testing")
public class ServiceCategoryApiControllerTest { public class ServiceCategoryApiControllerTest {
......
...@@ -31,6 +31,7 @@ import org.junit.Before; ...@@ -31,6 +31,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -50,7 +51,7 @@ import org.springframework.web.context.WebApplicationContext; ...@@ -50,7 +51,7 @@ import org.springframework.web.context.WebApplicationContext;
webEnvironment = SpringBootTest.WebEnvironment.MOCK, webEnvironment = SpringBootTest.WebEnvironment.MOCK,
classes = OpenAPISpringBoot.class classes = OpenAPISpringBoot.class
) )
//@AutoConfigureTestDatabase //this automatically uses h2 @AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureMockMvc @AutoConfigureMockMvc
@ActiveProfiles("testing") @ActiveProfiles("testing")
public class ServiceOrderApiControllerTest { public class ServiceOrderApiControllerTest {
......
...@@ -26,6 +26,7 @@ import org.junit.Before; ...@@ -26,6 +26,7 @@ import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; 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.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
...@@ -45,7 +46,7 @@ import org.springframework.web.context.WebApplicationContext; ...@@ -45,7 +46,7 @@ import org.springframework.web.context.WebApplicationContext;
webEnvironment = SpringBootTest.WebEnvironment.MOCK, webEnvironment = SpringBootTest.WebEnvironment.MOCK,
classes = OpenAPISpringBoot.class classes = OpenAPISpringBoot.class
) )
//@AutoConfigureTestDatabase //this automatically uses h2 @AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureMockMvc @AutoConfigureMockMvc
@ActiveProfiles("testing") @ActiveProfiles("testing")
public class ServiceOrderRepoServiceTest { public class ServiceOrderRepoServiceTest {
......
...@@ -37,21 +37,25 @@ import org.mockito.Mock; ...@@ -37,21 +37,25 @@ import org.mockito.Mock;
import static org.mockito.Mockito.times; import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
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.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.SpyBean; import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ArrayNode;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@Transactional
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.MOCK, classes = OpenAPISpringBoot.class)
@AutoConfigureTestDatabase //this automatically uses h2
@AutoConfigureMockMvc
@ActiveProfiles("testing") @ActiveProfiles("testing")
@SpringBootTest(classes = OpenAPISpringBoot.class) public class ServiceNSLCMRepoServiceTest {
//@DataJpaTest
public class ServiceRepoServiceTest {
@Mock @Mock
private ServiceRepository serviceRepository; private ServiceRepository serviceRepository;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment