use of org.springframework.security.web.server.header.ServerHttpHeadersWriter in project spring-security by spring-projects.
the class HeaderWriterServerLogoutHandlerTests method logoutWhenInvokedThenWritesResponseHeaders.
@Test
public void logoutWhenInvokedThenWritesResponseHeaders() {
ServerHttpHeadersWriter headersWriter = mock(ServerHttpHeadersWriter.class);
HeaderWriterServerLogoutHandler handler = new HeaderWriterServerLogoutHandler(headersWriter);
ServerWebExchange serverWebExchange = mock(ServerWebExchange.class);
WebFilterExchange filterExchange = mock(WebFilterExchange.class);
given(filterExchange.getExchange()).willReturn(serverWebExchange);
Authentication authentication = mock(Authentication.class);
handler.logout(filterExchange, authentication);
verify(headersWriter).writeHttpHeaders(serverWebExchange);
}
Aggregations