@Test public void testInternalServerException() { exceptionHandler.handleRemoteApiException(new RemoteApiException(500, new RuntimeException()), new IntegrationInstance(), INTEGRATION_USER, ""); }
public void handleRemoteApiException(RemoteApiException remoteException, IntegrationInstance instance, String integrationUser, String stream) { int code = remoteException.getCode(); Status status = Status.fromStatusCode(code); String message = logMessage.getMessage(UNABLE_POST_STREAM, stream, String.valueOf(code)); LOGGER.error(message, remoteException); if (isForbiddenError(status, remoteException.getResponseMessage())) { updateStreams(instance, integrationUser, stream); } else if (Status.BAD_REQUEST.equals(status)) { LOGGER.warn(logMessage.getMessage(INVALID_MESSAGE, stream, instance.getInstanceId()), remoteException); } }
IntegrationBridgeExceptionHandler extends ExceptionHandler { public void handleRemoteApiException(RemoteApiException remoteException, IntegrationInstance instance, String integrationUser, String stream) { int code = remoteException.getCode(); Status status = Status.fromStatusCode(code); String message = logMessage.getMessage(UNABLE_POST_STREAM, stream, String.valueOf(code)); LOGGER.error(message, remoteException); if (isForbiddenError(status, remoteException.getResponseMessage())) { updateStreams(instance, integrationUser, stream); } else if (Status.BAD_REQUEST.equals(status)) { LOGGER.warn(logMessage.getMessage(INVALID_MESSAGE, stream, instance.getInstanceId()), remoteException); } } }
IntegrationBridgeExceptionHandler extends ExceptionHandler { public void handleRemoteApiException(RemoteApiException remoteException, IntegrationInstance instance, String integrationUser, String stream) { int code = remoteException.getCode(); Status status = Status.fromStatusCode(code); String message = logMessage.getMessage(UNABLE_POST_STREAM, stream, String.valueOf(code)); LOGGER.error(message, remoteException); if (isForbiddenError(status, remoteException.getResponseMessage())) { updateStreams(instance, integrationUser, stream); } else if (Status.BAD_REQUEST.equals(status)) { LOGGER.warn(logMessage.getMessage(INVALID_MESSAGE, stream, instance.getInstanceId()), remoteException); } }  }
IntegrationBridgeExceptionHandler extends ExceptionHandler { public void handleRemoteApiException(RemoteApiException remoteException, IntegrationInstance instance, String integrationUser, String stream) { int code = remoteException.getCode(); Status status = Status.fromStatusCode(code); String message = logMessage.getMessage(UNABLE_POST_STREAM, stream, String.valueOf(code)); LOGGER.error(message, remoteException); if (isForbiddenError(status, remoteException.getResponseMessage())) { updateStreams(instance, integrationUser, stream); } else if (Status.BAD_REQUEST.equals(status)) { LOGGER.warn(logMessage.getMessage(INVALID_MESSAGE, stream, instance.getInstanceId()), remoteException); } }  @PostConstruct void init(); void handleRemoteApiException(RemoteApiException remoteException,
      IntegrationInstance instance, String integrationUser, String stream); void handleUnexpectedException(Exception e); }
IntegrationBridgeExceptionHandler extends ExceptionHandler { public void handleRemoteApiException(RemoteApiException remoteException, IntegrationInstance instance, String integrationUser, String stream) { int code = remoteException.getCode(); Status status = Status.fromStatusCode(code); String message = logMessage.getMessage(UNABLE_POST_STREAM, stream, String.valueOf(code)); LOGGER.error(message, remoteException); if (isForbiddenError(status, remoteException.getResponseMessage())) { updateStreams(instance, integrationUser, stream); } else if (Status.BAD_REQUEST.equals(status)) { LOGGER.warn(logMessage.getMessage(INVALID_MESSAGE, stream, instance.getInstanceId()), remoteException); } }  @PostConstruct void init(); void handleRemoteApiException(RemoteApiException remoteException,
      IntegrationInstance instance, String integrationUser, String stream); void handleUnexpectedException(Exception e);  }