add integration test profile

This commit is contained in:
DOHA 2016-10-20 13:44:16 +02:00
parent 1657916676
commit 017dc13db1
13 changed files with 62 additions and 15 deletions

View File

@ -133,10 +133,56 @@
<version>2.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IntegrationTest.java</exclude>
<exclude>**/*LiveTest.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*LiveTest.java</exclude>
</excludes>
<includes>
<include>**/*IntegrationTest.java</include>
</includes>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<test.mime>json</test.mime>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>spring-snapshots</id>

View File

@ -9,7 +9,7 @@ import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = WebjarsdemoApplication.class)
@WebAppConfiguration
public class WebjarsdemoApplicationTests {
public class WebjarsdemoApplicationIntegrationTest {
@Test
public void contextLoads() {

View File

@ -12,9 +12,9 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = CommitIdApplication.class)
public class CommitIdTest {
public class CommitIdIntegrationTest {
private static final Logger LOG = LoggerFactory.getLogger(CommitIdTest.class);
private static final Logger LOG = LoggerFactory.getLogger(CommitIdIntegrationTest.class);
@Value("${git.commit.message.short:UNKNOWN}")
private String commitMessage;

View File

@ -26,7 +26,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
public class SpringBootApplicationTest {
public class SpringBootApplicationIntegrationTest {
@Autowired
private WebApplicationContext webApplicationContext;
private MockMvc mockMvc;

View File

@ -13,7 +13,7 @@ import static org.junit.Assert.assertNotNull;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
public class SpringBootJPATest {
public class SpringBootJPAIntegrationTest {
@Autowired
private GenericEntityRepository genericEntityRepository;

View File

@ -24,7 +24,7 @@ import static org.junit.Assert.assertThat;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
public class SpringBootMailTest {
public class SpringBootMailIntegrationTest {
@Autowired
private JavaMailSender javaMailSender;

View File

@ -10,7 +10,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = Application.class)
@TestPropertySource("classpath:exception.properties")
public class ApplicationTests {
public class ApplicationIntegrationTest {
@Test
public void contextLoads() {
}

View File

@ -9,7 +9,7 @@ import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = DemoApplication.class)
@WebAppConfiguration
public class DemoApplicationTests {
public class DemoApplicationIntegrationTest {
@Test
public void contextLoads() {

View File

@ -2,7 +2,7 @@ package org.baeldung.boot.repository;
import static org.junit.Assert.assertThat;
import org.baeldung.boot.DemoApplicationTests;
import org.baeldung.boot.DemoApplicationIntegrationTest;
import org.baeldung.boot.model.Foo;
import static org.hamcrest.Matchers.notNullValue;
@ -14,7 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public class FooRepositoryTest extends DemoApplicationTests {
public class FooRepositoryIntegrationTest extends DemoApplicationIntegrationTest {
@Autowired
private FooRepository fooRepository;

View File

@ -4,7 +4,7 @@ import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import org.baeldung.boot.ApplicationTests;
import org.baeldung.boot.ApplicationIntegrationTest;
import org.baeldung.boot.model.Foo;
import org.baeldung.session.exception.repository.FooRepository;
import org.junit.Test;
@ -14,7 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional
@TestPropertySource("classpath:exception-hibernate.properties")
public class HibernateSessionTest extends ApplicationTests {
public class HibernateSessionIntegrationTest extends ApplicationIntegrationTest {
@Autowired
private FooRepository fooRepository;

View File

@ -1,6 +1,6 @@
package org.baeldung.boot.repository;
import org.baeldung.boot.ApplicationTests;
import org.baeldung.boot.ApplicationIntegrationTest;
import org.baeldung.boot.model.Foo;
import org.baeldung.session.exception.repository.FooRepository;
import org.hibernate.HibernateException;
@ -9,7 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@Transactional
public class NoHibernateSessionTest extends ApplicationTests {
public class NoHibernateSessionIntegrationTest extends ApplicationIntegrationTest {
@Autowired
private FooRepository fooRepository;

View File

@ -16,7 +16,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
@RunWith(SpringRunner.class)
@RestClientTest(DetailsServiceClient.class)
public class DetailsServiceClientTest {
public class DetailsServiceClientIntegrationTest {
@Autowired
private DetailsServiceClient client;

View File

@ -0,0 +1 @@
// dataflow 1.2.0.RELEASE log opened at 2016-10-20 13:13:20