use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class WelcomePageRouterFunctionFactoryTests method handlesRequestForStaticPageThatAcceptsAll.
@Test
void handlesRequestForStaticPageThatAcceptsAll() {
WebTestClient client = withStaticIndex();
client.get().uri("/").accept(MediaType.ALL).exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("welcome-page-static");
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class WelcomePageRouterFunctionFactoryTests method handlesRequestForTemplateThatAcceptsAll.
@Test
void handlesRequestForTemplateThatAcceptsAll() {
WebTestClient client = withTemplateIndex();
client.get().uri("/").accept(MediaType.ALL).exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("welcome-page-template");
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class WelcomePageRouterFunctionFactoryTests method handlesRequestWithNoAcceptHeader.
@Test
void handlesRequestWithNoAcceptHeader() {
WebTestClient client = withStaticIndex();
client.get().uri("/").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("welcome-page-static");
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class WelcomePageRouterFunctionFactoryTests method handlesRequestForTemplateThatAcceptsTextHtml.
@Test
void handlesRequestForTemplateThatAcceptsTextHtml() {
WebTestClient client = withTemplateIndex();
client.get().uri("/").accept(MediaType.TEXT_HTML).exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("welcome-page-template");
}
use of org.springframework.test.web.reactive.server.WebTestClient in project spring-boot by spring-projects.
the class WelcomePageRouterFunctionFactoryTests method handlesRequestWithEmptyAcceptHeader.
@Test
void handlesRequestWithEmptyAcceptHeader() {
WebTestClient client = withStaticIndex();
client.get().uri("/").header(HttpHeaders.ACCEPT, "").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("welcome-page-static");
}
Aggregations