### Question:
BasicAuthRequestConfig implements RequestConfig { public BasicAuthRequestConfig(final String username, final String password) { this.username = Validate.notBlank(username); this.password = Validate.notBlank(password); } BasicAuthRequestConfig(final String username, final String password); @Override Map<String, String> getHeaders(); static final String AUTHORIZATION_HEADER; static final String BASIC; }### Answer:
@Test public void testBasicAuthRequestConfig() { final String username = "user1"; final String password = "password"; final String basicCreds = username + ":" + password; final String expectedHeaderValue = "Basic " + Base64.getEncoder().encodeToString(basicCreds.getBytes(StandardCharsets.UTF_8)); final RequestConfig requestConfig = new BasicAuthRequestConfig(username, password); final Map<String,String> headers = requestConfig.getHeaders(); assertNotNull(headers); assertEquals(1, headers.size()); final String authorizationHeaderValue = headers.get("Authorization"); assertEquals(expectedHeaderValue, authorizationHeaderValue); }