Bumping versions

This commit is contained in:
buildmaster
2021-01-29 18:06:23 +00:00
parent 59cba50450
commit 16808fbef7
5 changed files with 19 additions and 23 deletions

View File

@@ -46,8 +46,7 @@ public class CorsTests extends BaseWebClientTests {
@Test
public void testPreFlightCorsRequest() {
ClientResponse clientResponse = webClient.options().uri("/abc/123/function").header("Origin", "domain.com")
.header("Access-Control-Request-Method", "GET")
.exchangeToMono(Mono::just).block();
.header("Access-Control-Request-Method", "GET").exchangeToMono(Mono::just).block();
HttpHeaders asHttpHeaders = clientResponse.headers().asHttpHeaders();
Mono<String> bodyToMono = clientResponse.bodyToMono(String.class);
// pre-flight request shouldn't return the response body
@@ -63,10 +62,7 @@ public class CorsTests extends BaseWebClientTests {
@Test
public void testCorsRequest() {
ResponseEntity<String> response = webClient.get().uri("/abc/123/function").header("Origin", "domain.com")
.header(HttpHeaders.HOST, "www.path.org")
.retrieve()
.toEntity(String.class)
.block();
.header(HttpHeaders.HOST, "www.path.org").retrieve().toEntity(String.class).block();
assertThat(response).isNotNull();
assertThat(response.getBody()).isNotNull();
assertThat(response.getHeaders().getAccessControlAllowOrigin())

View File

@@ -93,15 +93,13 @@ public class PathRoutePredicateFactoryTests extends BaseWebClientTests {
@Test
public void matchOptionalTrailingSeparatorCopiedToMatchTrailingSlash() {
Config config = new Config().setPatterns(Arrays.asList("patternA", "patternB"))
.setMatchTrailingSlash(false);
Config config = new Config().setPatterns(Arrays.asList("patternA", "patternB")).setMatchTrailingSlash(false);
assertThat(config.isMatchTrailingSlash()).isEqualTo(false);
}
@Test
public void toStringFormat() {
Config config = new Config().setPatterns(Arrays.asList("patternA", "patternB"))
.setMatchTrailingSlash(false);
Config config = new Config().setPatterns(Arrays.asList("patternA", "patternB")).setMatchTrailingSlash(false);
Predicate predicate = new PathRoutePredicateFactory().apply(config);
assertThat(predicate.toString()).contains("patternA").contains("patternB").contains("false");
}

View File

@@ -38,7 +38,8 @@ public class ConfigurationServiceTests {
public void validationOnCreateWorks() {
Map<String, Object> map = Collections.singletonMap("config.value", 11);
Assert.assertThrows(BindException.class, () -> ConfigurationService.bindOrCreate(Bindable.of(ValidatedConfig.class), map, "config", getValidator(), null));
Assert.assertThrows(BindException.class, () -> ConfigurationService
.bindOrCreate(Bindable.of(ValidatedConfig.class), map, "config", getValidator(), null));
}
@Test
@@ -57,7 +58,8 @@ public class ConfigurationServiceTests {
ValidatedConfig config = new ValidatedConfig();
Assert.assertThrows(BindException.class, () -> ConfigurationService.bindOrCreate(Bindable.ofInstance(config), map, "config", getValidator(), null));
Assert.assertThrows(BindException.class, () -> ConfigurationService.bindOrCreate(Bindable.ofInstance(config),
map, "config", getValidator(), null));
}

View File

@@ -123,16 +123,16 @@ public class SseIntegrationTests {
@Test
public void sseAsString() {
Flux<String> result = this.webClient.get().uri("/string").accept(TEXT_EVENT_STREAM)
.retrieve().bodyToFlux(String.class);
Flux<String> result = this.webClient.get().uri("/string").accept(TEXT_EVENT_STREAM).retrieve()
.bodyToFlux(String.class);
StepVerifier.create(result).expectNext("foo 0").expectNext("foo 1").thenCancel().verify(Duration.ofSeconds(5L));
}
@Test
public void sseAsPerson() {
Flux<Person> result = this.webClient.get().uri("/person").accept(TEXT_EVENT_STREAM)
.retrieve().bodyToFlux(Person.class);
Flux<Person> result = this.webClient.get().uri("/person").accept(TEXT_EVENT_STREAM).retrieve()
.bodyToFlux(Person.class);
StepVerifier.create(result).expectNext(new Person("foo 0")).expectNext(new Person("foo 1")).thenCancel()
.verify(Duration.ofSeconds(5L));
@@ -142,8 +142,9 @@ public class SseIntegrationTests {
@SuppressWarnings("Duplicates")
public void sseAsEvent() {
ResolvableType type = forClassWithGenerics(ServerSentEvent.class, String.class);
Flux<ServerSentEvent<String>> result = this.webClient.get().uri("/event").accept(TEXT_EVENT_STREAM)
.retrieve().bodyToFlux(new ParameterizedTypeReference<ServerSentEvent<String>>() { });
Flux<ServerSentEvent<String>> result = this.webClient.get().uri("/event").accept(TEXT_EVENT_STREAM).retrieve()
.bodyToFlux(new ParameterizedTypeReference<ServerSentEvent<String>>() {
});
StepVerifier.create(result).consumeNextWith(event -> {
assertThat(event.id()).isEqualTo("0");
@@ -163,8 +164,9 @@ public class SseIntegrationTests {
@Test
@SuppressWarnings("Duplicates")
public void sseAsEventWithoutAcceptHeader() {
Flux<ServerSentEvent<String>> result = this.webClient.get().uri("/event").accept(TEXT_EVENT_STREAM)
.retrieve().bodyToFlux(new ParameterizedTypeReference<ServerSentEvent<String>>() { });
Flux<ServerSentEvent<String>> result = this.webClient.get().uri("/event").accept(TEXT_EVENT_STREAM).retrieve()
.bodyToFlux(new ParameterizedTypeReference<ServerSentEvent<String>>() {
});
StepVerifier.create(result).consumeNextWith(event -> {
assertThat(event.id()).isEqualTo("0");

View File

@@ -36,9 +36,7 @@ public class ReactorHttpServer extends AbstractHttpServer {
@Override
protected void initServer() {
this.reactorHandler = createHttpHandlerAdapter();
this.reactorServer = reactor.netty.http.server.HttpServer.create()
.host(getHost())
.port(getPort());
this.reactorServer = reactor.netty.http.server.HttpServer.create().host(getHost()).port(getPort());
}