@Test(expected = RemoteApiException.class) public void testApiCallRemoteApiException() throws RemoteApiException { doThrow(RemoteApiException.class).when(apiClient) .doPost(eq(PATH), anyMap(), anyMap(), isNull(), eq(Token.class)); authenticationApiClient.authenticate(MOCK_USER); }
public Token authenticate(String userId) throws RemoteApiException { String path = "/v1/authenticate"; Map<String, String> headerParams = new HashMap<>(); headerParams.put("userSession", userId); Map<String, String> queryParams = new HashMap<>(); return apiClient.doPost(path, headerParams, queryParams, null, Token.class); }
AuthenticationApiClient { public Token authenticate(String userId) throws RemoteApiException { String path = "/v1/authenticate"; Map<String, String> headerParams = new HashMap<>(); headerParams.put("userSession", userId); Map<String, String> queryParams = new HashMap<>(); return apiClient.doPost(path, headerParams, queryParams, null, Token.class); } }
AuthenticationApiClient { public Token authenticate(String userId) throws RemoteApiException { String path = "/v1/authenticate"; Map<String, String> headerParams = new HashMap<>(); headerParams.put("userSession", userId); Map<String, String> queryParams = new HashMap<>(); return apiClient.doPost(path, headerParams, queryParams, null, Token.class); } AuthenticationApiClient(HttpApiClient apiClient); }
AuthenticationApiClient { public Token authenticate(String userId) throws RemoteApiException { String path = "/v1/authenticate"; Map<String, String> headerParams = new HashMap<>(); headerParams.put("userSession", userId); Map<String, String> queryParams = new HashMap<>(); return apiClient.doPost(path, headerParams, queryParams, null, Token.class); } AuthenticationApiClient(HttpApiClient apiClient); Token authenticate(String userId); }
AuthenticationApiClient { public Token authenticate(String userId) throws RemoteApiException { String path = "/v1/authenticate"; Map<String, String> headerParams = new HashMap<>(); headerParams.put("userSession", userId); Map<String, String> queryParams = new HashMap<>(); return apiClient.doPost(path, headerParams, queryParams, null, Token.class); } AuthenticationApiClient(HttpApiClient apiClient); Token authenticate(String userId);  }