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:
@@ -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!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user