Merge pull request #7051 from amit2103/BAEL-14846
[BAEL-14846] - Fixed tests in spring-5-reactive module
This commit is contained in:
commit
d256ea0526
@ -1,10 +1,13 @@
|
|||||||
package com.baeldung.reactive.errorhandling;
|
package com.baeldung.reactive.errorhandling;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
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.web.reactive.AutoConfigureWebTestClient;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@ -15,6 +18,7 @@ import org.springframework.test.web.reactive.server.WebTestClient;
|
|||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
|
@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT)
|
||||||
@WithMockUser
|
@WithMockUser
|
||||||
|
@AutoConfigureWebTestClient(timeout = "10000")
|
||||||
public class ErrorHandlingIntegrationTest {
|
public class ErrorHandlingIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -3,6 +3,7 @@ package com.baeldung.reactive.filters;
|
|||||||
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.web.reactive.AutoConfigureWebTestClient;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.security.test.context.support.WithMockUser;
|
import org.springframework.security.test.context.support.WithMockUser;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
@ -14,6 +15,7 @@ import static org.junit.Assert.assertEquals;
|
|||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||||
@WithMockUser
|
@WithMockUser
|
||||||
|
@AutoConfigureWebTestClient(timeout = "10000")
|
||||||
public class PlayerHandlerIntegrationTest {
|
public class PlayerHandlerIntegrationTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -28,7 +28,7 @@ public class PostExecutionUnitTest {
|
|||||||
.expectComplete()
|
.expectComplete()
|
||||||
.verifyThenAssertThat()
|
.verifyThenAssertThat()
|
||||||
.hasDropped(4)
|
.hasDropped(4)
|
||||||
.tookLessThan(Duration.ofMillis(1050));
|
.tookLessThan(Duration.ofMillis(1500));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user