@Test void testCheckUnhealthy() { DynamoDbClient client = mock(DynamoDbClient.class); DynamoDbHealthCheck healthCheck = new DynamoDbHealthCheck(client); when(client.listTables()).thenReturn( ListTablesResponse.builder() .tableNames(Collections.emptyList()) .build()); assertFalse(healthCheck.check()::isHealthy); }
@Override protected Result check() { LOG.info("Checking health of AWS DynamoDB..."); return dynamoDbClient.listTables().tableNames().size() > 0 ? Result.healthy() : Result.unhealthy("No tables listed in Dynamo DB."); }
DynamoDbHealthCheck extends DatabaseHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS DynamoDB..."); return dynamoDbClient.listTables().tableNames().size() > 0 ? Result.healthy() : Result.unhealthy("No tables listed in Dynamo DB."); } }
DynamoDbHealthCheck extends DatabaseHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS DynamoDB..."); return dynamoDbClient.listTables().tableNames().size() > 0 ? Result.healthy() : Result.unhealthy("No tables listed in Dynamo DB."); } @Inject  DynamoDbHealthCheck(DynamoDbClient dynamoDbClient); }
DynamoDbHealthCheck extends DatabaseHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS DynamoDB..."); return dynamoDbClient.listTables().tableNames().size() > 0 ? Result.healthy() : Result.unhealthy("No tables listed in Dynamo DB."); } @Inject  DynamoDbHealthCheck(DynamoDbClient dynamoDbClient);  }
DynamoDbHealthCheck extends DatabaseHealthCheck { @Override protected Result check() { LOG.info("Checking health of AWS DynamoDB..."); return dynamoDbClient.listTables().tableNames().size() > 0 ? Result.healthy() : Result.unhealthy("No tables listed in Dynamo DB."); } @Inject  DynamoDbHealthCheck(DynamoDbClient dynamoDbClient);   }