Adapt WebFlux.fn auto-config to SPR-15536

Since SPR-15536, WebFlux.fn is now configured with `@EnableWebFlux`,
along the annotated controllers. Both `RouterFunction` and Controller
instances can now live within the same application and they share
the same web infrastructure.

This commit removes the custom auto-configuration for `RouterFunction`
and relies on `@EnableWebFlux` for that.

Closes gh-9165
This commit is contained in:
Brian Clozel
2017-05-24 14:44:29 +02:00
parent 0bce35fef9
commit fed8c8a681
6 changed files with 56 additions and 171 deletions

View File

@@ -18,6 +18,7 @@ package sample.webflux;
import org.junit.Test;
import org.junit.runner.RunWith;
import reactor.core.publisher.Mono;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -44,4 +45,14 @@ public class SampleWebFluxApplicationTests {
.expectBody(String.class).isEqualTo("Hello World");
}
@Test
public void testEcho() throws Exception {
this.webClient.post().uri("/echo")
.contentType(MediaType.TEXT_PLAIN)
.accept(MediaType.TEXT_PLAIN)
.body(Mono.just("Hello WebFlux!"), String.class)
.exchange()
.expectBody(String.class).isEqualTo("Hello WebFlux!");
}
}