PreAuthenticatedAuthenticationProvider extends TimeMeasuringAuthenticationProvider<AuthenticationResult> { @Override public boolean isApplicable(final RequestContext requestContext) { return containsHeader(requestContext, HttpHeader.X_DITTO_PRE_AUTH) || containsHeader(requestContext, HttpHeader.X_DITTO_DUMMY_AUTH); } private  PreAuthenticatedAuthenticationProvider(); static PreAuthenticatedAuthenticationProvider getInstance(); @Override boolean isApplicable(final RequestContext requestContext); @Override AuthorizationContextType getType(final RequestContext requestContext);  }
@Test public void isApplicableWithDummyAuthHeader() { final boolean applicable = underTest.isApplicable(mockRequestContext(DUMMY_AUTH_HEADER, null)); assertThat(applicable).isTrue(); }
@Test public void isApplicableWithDummyAuthQueryParam() { final boolean applicable = underTest.isApplicable(mockRequestContext(null, DUMMY_AUTH_QUERY)); assertThat(applicable).isTrue(); }
@Test public void isApplicableWithDummyAuthQueryParamAndDummyAuthHeader() { final boolean applicable = underTest.isApplicable(mockRequestContext(DUMMY_AUTH_HEADER, DUMMY_AUTH_QUERY)); assertThat(applicable).isTrue(); }
@Test public void isApplicableFails() { final boolean applicable = underTest.isApplicable(mockRequestContext(null, null)); assertThat(applicable).isFalse(); }