@Test void testCheckHealthy() { SesClient client = mock(SesClient.class); SesHealthCheck healthCheck = new SesHealthCheck(client); when(client.getAccountSendingEnabled()).thenReturn( GetAccountSendingEnabledResponse.builder().enabled(true).build()); assertTrue(healthCheck.check()::isHealthy); }
@Override protected Result check() { LOG.info("Checking health of AWS Simple Email Service..."); try { return sesClient.getAccountSendingEnabled().enabled() ? Result.healthy() : Result.unhealthy("The configured SES account is not enabled for sending emails."); } catch (Exception e) { LOG.error("There was an exception when checking health of SES.", e); return Result.unhealthy("There is an issue communicating with SES."); } }
SesHealthCheck extends EmailHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS Simple Email Service..."); try { return sesClient.getAccountSendingEnabled().enabled() ? Result.healthy() : Result.unhealthy("The configured SES account is not enabled for sending emails."); } catch (Exception e) { LOG.error("There was an exception when checking health of SES.", e); return Result.unhealthy("There is an issue communicating with SES."); } } }
SesHealthCheck extends EmailHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS Simple Email Service..."); try { return sesClient.getAccountSendingEnabled().enabled() ? Result.healthy() : Result.unhealthy("The configured SES account is not enabled for sending emails."); } catch (Exception e) { LOG.error("There was an exception when checking health of SES.", e); return Result.unhealthy("There is an issue communicating with SES."); } } @Inject  SesHealthCheck(SesClient sesClient); }
SesHealthCheck extends EmailHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS Simple Email Service..."); try { return sesClient.getAccountSendingEnabled().enabled() ? Result.healthy() : Result.unhealthy("The configured SES account is not enabled for sending emails."); } catch (Exception e) { LOG.error("There was an exception when checking health of SES.", e); return Result.unhealthy("There is an issue communicating with SES."); } } @Inject  SesHealthCheck(SesClient sesClient);  }
SesHealthCheck extends EmailHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS Simple Email Service..."); try { return sesClient.getAccountSendingEnabled().enabled() ? Result.healthy() : Result.unhealthy("The configured SES account is not enabled for sending emails."); } catch (Exception e) { LOG.error("There was an exception when checking health of SES.", e); return Result.unhealthy("There is an issue communicating with SES."); } } @Inject  SesHealthCheck(SesClient sesClient);   }