@Test public void testGetIntegrationById() throws RemoteApiException { Map<String, String> headerParams = new HashMap<>(); headerParams.put("sessionToken", MOCK_SESSION); IntegrationSettings integration = mockIntegration(); String path = "/v1/configuration/" + MOCK_CONFIGURATION_ID; doReturn(MOCK_CONFIGURATION_ID).when(httpClient).escapeString(MOCK_CONFIGURATION_ID); doReturn(integration).when(httpClient) .doGet(path, headerParams, Collections.<String, String>emptyMap(), IntegrationSettings.class); IntegrationSettings result = apiClient.getIntegrationById(MOCK_SESSION, MOCK_CONFIGURATION_ID); assertEquals(integration, result); }
public IntegrationSettings getIntegrationById(String sessionToken, String integrationId) throws RemoteApiException { checkAuthToken(sessionToken); if (integrationId == null) { String reason = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING, INTEGRATION_ID, GET_INTEGRATION_BY_ID); String solution = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING_SOLUTION, INTEGRATION_ID); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/configuration/" + apiClient.escapeString(integrationId); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doGet(path, headerParams, Collections.<String, String>emptyMap(), IntegrationSettings.class); }
IntegrationApiClient extends BasePodApiClient { public IntegrationSettings getIntegrationById(String sessionToken, String integrationId) throws RemoteApiException { checkAuthToken(sessionToken); if (integrationId == null) { String reason = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING, INTEGRATION_ID, GET_INTEGRATION_BY_ID); String solution = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING_SOLUTION, INTEGRATION_ID); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/configuration/" + apiClient.escapeString(integrationId); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doGet(path, headerParams, Collections.<String, String>emptyMap(), IntegrationSettings.class); } }
IntegrationApiClient extends BasePodApiClient { public IntegrationSettings getIntegrationById(String sessionToken, String integrationId) throws RemoteApiException { checkAuthToken(sessionToken); if (integrationId == null) { String reason = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING, INTEGRATION_ID, GET_INTEGRATION_BY_ID); String solution = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING_SOLUTION, INTEGRATION_ID); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/configuration/" + apiClient.escapeString(integrationId); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doGet(path, headerParams, Collections.<String, String>emptyMap(), IntegrationSettings.class); } IntegrationApiClient(HttpApiClient apiClient, LogMessageSource logMessage); }
IntegrationApiClient extends BasePodApiClient { public IntegrationSettings getIntegrationById(String sessionToken, String integrationId) throws RemoteApiException { checkAuthToken(sessionToken); if (integrationId == null) { String reason = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING, INTEGRATION_ID, GET_INTEGRATION_BY_ID); String solution = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING_SOLUTION, INTEGRATION_ID); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/configuration/" + apiClient.escapeString(integrationId); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doGet(path, headerParams, Collections.<String, String>emptyMap(), IntegrationSettings.class); } IntegrationApiClient(HttpApiClient apiClient, LogMessageSource logMessage); IntegrationSettingsList listIntegrations(String sessionToken, int offset, int limit); IntegrationSettings getIntegrationById(String sessionToken, String integrationId); IntegrationSettings getIntegrationByType(String sessionToken, String integrationType); IntegrationSettings createIntegration(String sessionToken,
      IntegrationSubmissionCreate integration); IntegrationSettings updateIntegration(String sessionToken, String integrationId,
      IntegrationSubmissionCreate integration); IntegrationSettings activateIntegration(String sessionToken, String integrationId); IntegrationSettings deactivateIntegration(String sessionToken, String integrationId); }
IntegrationApiClient extends BasePodApiClient { public IntegrationSettings getIntegrationById(String sessionToken, String integrationId) throws RemoteApiException { checkAuthToken(sessionToken); if (integrationId == null) { String reason = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING, INTEGRATION_ID, GET_INTEGRATION_BY_ID); String solution = logMessage.getMessage(MISSING_PARAMETER_WHEN_CALLING_SOLUTION, INTEGRATION_ID); throw new RemoteApiException(HTTP_BAD_REQUEST_ERROR, reason, solution); } String path = "/v1/configuration/" + apiClient.escapeString(integrationId); Map<String, String> headerParams = new HashMap<>(); headerParams.put(SESSION_TOKEN_HEADER_PARAM, sessionToken); return apiClient.doGet(path, headerParams, Collections.<String, String>emptyMap(), IntegrationSettings.class); } IntegrationApiClient(HttpApiClient apiClient, LogMessageSource logMessage); IntegrationSettingsList listIntegrations(String sessionToken, int offset, int limit); IntegrationSettings getIntegrationById(String sessionToken, String integrationId); IntegrationSettings getIntegrationByType(String sessionToken, String integrationType); IntegrationSettings createIntegration(String sessionToken,
      IntegrationSubmissionCreate integration); IntegrationSettings updateIntegration(String sessionToken, String integrationId,
      IntegrationSubmissionCreate integration); IntegrationSettings activateIntegration(String sessionToken, String integrationId); IntegrationSettings deactivateIntegration(String sessionToken, String integrationId);  }