BasicAuthorizationHeaderModifier implements HeaderModifier { @Override public boolean matches(Header header) { return "Authorization".equals(header.name()) && header.value().startsWith("Basic"); } BasicAuthorizationHeaderModifier(Base64Decoder base64Decoder); @Override boolean matches(Header header); @Override Header modify(Header header);  }
@Test public void basicAuthorizationHeader_shouldMatch_modifier() throws Exception { assertThat(headerModifier.matches(basicAuthHeader), is(true)); }
@Test public void nonBasicAuthorizationHeader_shouldNotMatch_modifier() throws Exception { final Header header = new Header("Authorization", "Non basic header value"); assertThat(headerModifier.matches(header), is(false)); }