@Test
public void testCheckNoDynamoDBClient() throws StatusCheckException, IOException {

    // Mock getting client and credentials successfully and table exists
    String tableName = "testTable";
    when(listTablesResult.getTableNames()).thenReturn(Collections.singletonList(tableName));
    DynamoDBClientAndCredentials dynamoDBClientAndCredentials = new DynamoDBClientAndCredentials(null, awsCredentialsProvider);
    when(dynamoDBClientFetcher.getDynamoDBClient(any(), any())).thenReturn(dynamoDBClientAndCredentials);
    DynamoDBStatusCheckerTestClass dynamoDBStatusChecker = new DynamoDBStatusCheckerTestClass(tableName);
    try {
        dynamoDBStatusChecker.check();
        fail();
    } catch (StatusCheckException ex) {
        assertEquals(500, ex.getCode());
        Mockito.verify(amazonDynamoDB, times(0)).shutdown();
        Mockito.verify(awsCredentialsProvider, times(1)).close();
    }
}