### Question:
AuthenticationRealmAwareFilter implements Filter { void setupRealmInResponse(ServletResponse servletResponse) { HttpServletResponse response = (HttpServletResponse) servletResponse; String realm = oidcAuthenticationHelper.getRealmForCurrentRequest(); response.setHeader(SecurityConstants.REALM_HEADER, realm); } @Autowired  AuthenticationRealmAwareFilter(OidcAuthenticationHelper oidcAuthenticationHelper); @Override void init(FilterConfig filterConfig); @Override void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain); @Override void destroy(); @Value("${security.oidc.AuthenticationRealmAwareFilter.enable:true}") void setEnableFilter(boolean enableFilter); @Value("${security.oidc.AuthenticationRealmAwareFilter.realmUrlPattern:}") void setRealmUrlPattern(String realmUrlPattern); @Value("${security.oidc.AuthenticationRealmAwareFilter.filterApplyUrlRegex:}") void setFilterApplyUrlRegex(String filterApplyUrlRegex); @Value("${security.oidc.AuthenticationRealmAwareFilter.realmParamName:realm}") void setRealmParamName(String realmParamName); @Value("${security.oidc.AuthenticationRealmAwareFilter.isRealmMandatory:true}") void setRealmMandatory(boolean realmMandatory); @Value("#{'${security.oidc.AuthenticationRealmAwareFilter.filterApplyUrlList:}'.split(',')}") void setFilterApplyUrlList(List<String> filterApplyUrlList); @Value("#{'${security.oidc.AuthenticationRealmAwareFilter.filterIgnoreUrlList:}'.split(',')}") void setFilterIgnoreUrls(List<String> filterIgnoreUrlList); @Override String toString(); static final String BASE_REALM_REGEX; }### Answer:
@Test void setupRealmInResponse() { MockHttpServletRequest request = new MockHttpServletRequest(); String realm = "SOME_REALM"; request.addHeader(SecurityConstants.REALM_HEADER, realm); authenticationRealmAwareFilter.setupRealmFromHeader(request); MockHttpServletResponse response = new MockHttpServletResponse(); authenticationRealmAwareFilter.setupRealmInResponse(response); assertThat(response.getHeader(SecurityConstants.REALM_HEADER), is(realm)); }