BAEL-9496 Fix failing context tests (#7855)
* BAEL-9496 Fix failing context tests - Fixes for SpringContextIntegrationTest in several projects * BAEL-9496 Fix failing context tests -Fixed ContextTests for spring-jms and further fixes spring-session-mongodb * BAEL-9496 Fix failing context tests -Fixed context tests from spring-rest-angular project
This commit is contained in:
committed by
Josh Cummings
parent
6f9c339986
commit
af75e04e50
@@ -40,6 +40,12 @@
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>de.flapdoodle.embed</groupId>
|
||||
<artifactId>de.flapdoodle.embed.mongo</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SpringSessionMongoDBApplication.class)
|
||||
@SpringBootTest(classes = SpringSessionMongoDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class SpringContextIntegrationTest {
|
||||
|
||||
@Test
|
||||
|
||||
@@ -7,8 +7,8 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = SpringSessionMongoDBApplication.class)
|
||||
public class SpringContextLiveTest {
|
||||
@SpringBootTest(classes = SpringSessionMongoDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public class SpringContextTest {
|
||||
|
||||
@Test
|
||||
public void whenSpringContextIsBootstrapped_thenNoExceptions() {
|
||||
@@ -0,0 +1,2 @@
|
||||
#To use a randomly allocated free port during tests to avoid port conflict across tests
|
||||
spring.data.mongodb.port=0
|
||||
Reference in New Issue
Block a user