@Test(expected = RemoteConfigurationException.class) public void testGetIntegrationByTypeFailed() throws Exception { doThrow(RemoteApiException.class).when(configurationApiClient) .getIntegrationByType(TOKEN, CONFIGURATION_TYPE); remoteIntegrationService.getIntegrationByType(CONFIGURATION_TYPE, USER_ID); }
@Override public IntegrationSettings getIntegrationByType(String integrationType, String userId) { try { return configurationApiClient.getIntegrationByType(authenticationProxy.getSessionToken(userId), integrationType); } catch (RemoteApiException e) { checkExceptionCodeForbidden(e); if (e.getCode() == BAD_REQUEST.getStatusCode()) { String message = logMessage.getMessage(INTEGRATION_NOT_FOUND, integrationType); String solution = logMessage.getMessage(INTEGRATION_NOT_FOUND_SOLUTION, integrationType); throw new ConfigurationNotFoundException(message, solution); } throw getUnknownException(e); } }
RemoteIntegrationService implements IntegrationService { @Override public IntegrationSettings getIntegrationByType(String integrationType, String userId) { try { return configurationApiClient.getIntegrationByType(authenticationProxy.getSessionToken(userId), integrationType); } catch (RemoteApiException e) { checkExceptionCodeForbidden(e); if (e.getCode() == BAD_REQUEST.getStatusCode()) { String message = logMessage.getMessage(INTEGRATION_NOT_FOUND, integrationType); String solution = logMessage.getMessage(INTEGRATION_NOT_FOUND_SOLUTION, integrationType); throw new ConfigurationNotFoundException(message, solution); } throw getUnknownException(e); } } }
RemoteIntegrationService implements IntegrationService { @Override public IntegrationSettings getIntegrationByType(String integrationType, String userId) { try { return configurationApiClient.getIntegrationByType(authenticationProxy.getSessionToken(userId), integrationType); } catch (RemoteApiException e) { checkExceptionCodeForbidden(e); if (e.getCode() == BAD_REQUEST.getStatusCode()) { String message = logMessage.getMessage(INTEGRATION_NOT_FOUND, integrationType); String solution = logMessage.getMessage(INTEGRATION_NOT_FOUND_SOLUTION, integrationType); throw new ConfigurationNotFoundException(message, solution); } throw getUnknownException(e); } }  }
RemoteIntegrationService implements IntegrationService { @Override public IntegrationSettings getIntegrationByType(String integrationType, String userId) { try { return configurationApiClient.getIntegrationByType(authenticationProxy.getSessionToken(userId), integrationType); } catch (RemoteApiException e) { checkExceptionCodeForbidden(e); if (e.getCode() == BAD_REQUEST.getStatusCode()) { String message = logMessage.getMessage(INTEGRATION_NOT_FOUND, integrationType); String solution = logMessage.getMessage(INTEGRATION_NOT_FOUND_SOLUTION, integrationType); throw new ConfigurationNotFoundException(message, solution); } throw getUnknownException(e); } }  @Override @PostConstruct void init(); @Override IntegrationSettings getIntegrationById(String integrationId, String userId); @Override IntegrationSettings getIntegrationByType(String integrationType, String userId); @Override IntegrationSettings save(IntegrationSettings settings, String userId); @Override IntegrationInstance getInstanceById(String configurationId, String instanceId,
      String userId); @Override IntegrationInstance save(IntegrationInstance instance, String userId); }
RemoteIntegrationService implements IntegrationService { @Override public IntegrationSettings getIntegrationByType(String integrationType, String userId) { try { return configurationApiClient.getIntegrationByType(authenticationProxy.getSessionToken(userId), integrationType); } catch (RemoteApiException e) { checkExceptionCodeForbidden(e); if (e.getCode() == BAD_REQUEST.getStatusCode()) { String message = logMessage.getMessage(INTEGRATION_NOT_FOUND, integrationType); String solution = logMessage.getMessage(INTEGRATION_NOT_FOUND_SOLUTION, integrationType); throw new ConfigurationNotFoundException(message, solution); } throw getUnknownException(e); } }  @Override @PostConstruct void init(); @Override IntegrationSettings getIntegrationById(String integrationId, String userId); @Override IntegrationSettings getIntegrationByType(String integrationType, String userId); @Override IntegrationSettings save(IntegrationSettings settings, String userId); @Override IntegrationInstance getInstanceById(String configurationId, String instanceId,
      String userId); @Override IntegrationInstance save(IntegrationInstance instance, String userId);  }