Merge pull request #8055 from at508/master

[BAEL-2998] - Fix jenkins tests
This commit is contained in:
Eric Martin
2019-10-21 22:13:25 -05:00
committed by GitHub
5 changed files with 29 additions and 9 deletions

View File

@@ -84,6 +84,11 @@
<version>${junit.jupiter.version}</version> <version>${junit.jupiter.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>${junit.commons.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.awaitility</groupId> <groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId> <artifactId>awaitility</artifactId>
@@ -112,7 +117,8 @@
<!-- testing --> <!-- testing -->
<hamcrest.version>2.0.0.0</hamcrest.version> <hamcrest.version>2.0.0.0</hamcrest.version>
<awaitility.version>3.1.6</awaitility.version> <awaitility.version>3.1.6</awaitility.version>
<junit.jupiter.version>5.4.0</junit.jupiter.version> <junit.jupiter.version>5.5.0</junit.jupiter.version>
<junit.commons.version>1.5.2</junit.commons.version>
<spring.version>5.1.4.RELEASE</spring.version> <spring.version>5.1.4.RELEASE</spring.version>
<javax.servlet-api.version>4.0.1</javax.servlet-api.version> <javax.servlet-api.version>4.0.1</javax.servlet-api.version>
<javax.persistence.version>2.1.1</javax.persistence.version> <javax.persistence.version>2.1.1</javax.persistence.version>

View File

@@ -10,10 +10,12 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.MethodMode; import org.springframework.test.annotation.DirtiesContext.MethodMode;
import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@TestMethodOrder(OrderAnnotation.class) @TestMethodOrder(OrderAnnotation.class)
@ExtendWith(SpringExtension.class) @ExtendWith(SpringExtension.class)
@SpringBootTest(classes = SpringDataRestApplication.class) @SpringBootTest(classes = SpringDataRestApplication.class)
@EnableWebMvc
class DirtiesContextIntegrationTest { class DirtiesContextIntegrationTest {
@Autowired @Autowired

View File

@@ -1,21 +1,25 @@
package com.baeldung.overrideproperties; package com.baeldung.overrideproperties;
import com.baeldung.overrideproperties.resolver.PropertySourceResolver; import static org.junit.Assert.assertEquals;
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.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
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.web.servlet.config.annotation.EnableWebMvc;
import static org.junit.Assert.assertEquals; import com.baeldung.overrideproperties.resolver.PropertySourceResolver;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
@ActiveProfiles("test") @ActiveProfiles("test")
@EnableWebMvc
public class ProfilePropertySourceResolverIntegrationTest { public class ProfilePropertySourceResolverIntegrationTest {
@Autowired private PropertySourceResolver propertySourceResolver; @Autowired
private PropertySourceResolver propertySourceResolver;
@Test @Test
public void shouldProfiledProperty_overridePropertyValues() { public void shouldProfiledProperty_overridePropertyValues() {

View File

@@ -1,18 +1,22 @@
package com.baeldung.overrideproperties; package com.baeldung.overrideproperties;
import com.baeldung.overrideproperties.resolver.PropertySourceResolver;
import org.junit.Assert; import org.junit.Assert;
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.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import com.baeldung.overrideproperties.resolver.PropertySourceResolver;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest(properties = { "example.firstProperty=annotation" }) @SpringBootTest(properties = { "example.firstProperty=annotation" })
@EnableWebMvc
public class SpringBootPropertySourceResolverIntegrationTest { public class SpringBootPropertySourceResolverIntegrationTest {
@Autowired private PropertySourceResolver propertySourceResolver; @Autowired
private PropertySourceResolver propertySourceResolver;
@Test @Test
public void shouldSpringBootTestAnnotation_overridePropertyValues() { public void shouldSpringBootTestAnnotation_overridePropertyValues() {

View File

@@ -1,19 +1,23 @@
package com.baeldung.overrideproperties; package com.baeldung.overrideproperties;
import com.baeldung.overrideproperties.resolver.PropertySourceResolver; import static org.junit.Assert.assertEquals;
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.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import static org.junit.Assert.assertEquals; import com.baeldung.overrideproperties.resolver.PropertySourceResolver;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
@EnableWebMvc
public class TestResourcePropertySourceResolverIntegrationTest { public class TestResourcePropertySourceResolverIntegrationTest {
@Autowired private PropertySourceResolver propertySourceResolver; @Autowired
private PropertySourceResolver propertySourceResolver;
@Test @Test
public void shouldTestResourceFile_overridePropertyValues() { public void shouldTestResourceFile_overridePropertyValues() {