### Question:
AuthorizationApiClient extends BaseClient implements IAMApi { public String retrieveAuthCode(String action, String sessionId, String sessionData) { Request request = new Request.Builder() .url(this.createConsentUrl()) .addHeader(HttpHeaders.CONTENT_TYPE, BaseClientBuilder.MEDIA_TYPE_FORM.toString()) .post(createConsentFormBody(action, sessionId, sessionData)).build(); Response response = execute(this.noRedirectClient, request); return this.extractAuthCode(response); } AuthorizationApiClient(OAuthConfig config);   AuthorizationApiClient(OAuthConfig config, OkHttpClient redirectClient, OkHttpClient noRedirectClient); String authorize(String clientId, String redirectUri, String scopes, String codeChallenge); String authorize(String clientId, String redirectUri, String scopes); String retrieveAuthCode(String action, String sessionId, String sessionData);  }### Answer:
@Test public void testRetrieveAuthCode_whenPresentInLocationHeader_shouldReturnExtractedCode() { Mockito.when(mockResponse.headers(eq("Location"))).thenReturn(Collections.singletonList("http: assertThat(apiClient.retrieveAuthCode("Grant", "session-id", "session-data")).isEqualTo("28231715-ef6c-4742-9914-498d4aa391bf"); }
@Test public void testRetrieveAuthCode_whenNotPresentInLocationHeader_shouldReturnEmptyString() { Mockito.when(mockResponse.headers(eq("Location"))).thenReturn(Collections.<String>emptyList()); assertThat(apiClient.retrieveAuthCode("Grant", "session-id", "session-data")).isEqualTo(""); }