use of jakarta.servlet.ServletRequest in project spring-security by spring-projects.
the class JaasApiIntegrationFilterTests method assertJaasSubjectEquals.
private void assertJaasSubjectEquals(final Subject expectedValue) throws Exception {
MockFilterChain chain = new MockFilterChain() {
@Override
public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException {
// See if the subject was updated
Subject currentSubject = Subject.getSubject(AccessController.getContext());
assertThat(currentSubject).isEqualTo(expectedValue);
// run so we know the chain was executed
super.doFilter(request, response);
}
};
this.filter.doFilter(this.request, this.response, chain);
// ensure that the chain was actually invoked
assertThat(chain.getRequest()).isNotNull();
}
Aggregations