Search in sources :

Example 1 with WebHandlerResult

use of org.springframework.security.test.web.reactive.server.WebTestHandler.WebHandlerResult in project spring-security by spring-projects.

the class HttpHeaderWriterWebFilterTests method filterWhenNotCompleteThenNotWritten.

@Test
public void filterWhenNotCompleteThenNotWritten() {
    WebTestHandler handler = WebTestHandler.bindToWebFilters(this.filter);
    WebHandlerResult result = handler.exchange(MockServerHttpRequest.get("/foo"));
    verify(this.writer, never()).writeHttpHeaders(any());
    result.getExchange().getResponse().setComplete().block();
    verify(this.writer).writeHttpHeaders(any());
}
Also used : WebTestHandler(org.springframework.security.test.web.reactive.server.WebTestHandler) WebHandlerResult(org.springframework.security.test.web.reactive.server.WebTestHandler.WebHandlerResult) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 WebTestHandler (org.springframework.security.test.web.reactive.server.WebTestHandler)1 WebHandlerResult (org.springframework.security.test.web.reactive.server.WebTestHandler.WebHandlerResult)1