@Test
public void testTableNotFound() throws IOException {

    String requestedTable = "requestedTable";
    String tableNameInAws = "someExistingTable";
    // Mock getting client and credentials successfully but table doesn't exist
    when(listTablesResult.getTableNames()).thenReturn(Collections.singletonList(tableNameInAws));
    when(amazonDynamoDB.listTables()).thenReturn(listTablesResult);
    DynamoDBClientAndCredentials dynamoDBClientAndCredentials = new DynamoDBClientAndCredentials(amazonDynamoDB, awsCredentialsProvider);
    when(dynamoDBClientFetcher.getDynamoDBClient(any(), any())).thenReturn(dynamoDBClientAndCredentials);
    DynamoDBStatusCheckerTestClass dynamoDBStatusChecker = new DynamoDBStatusCheckerTestClass(requestedTable);
    try {
        dynamoDBStatusChecker.check();
        fail();
    } catch (StatusCheckException ex) {
        assertEquals("Table named " + requestedTable + " wasn't found in DynamoDB", ex.getMsg());
        assertEquals(200, ex.getCode());
    }
    Mockito.verify(amazonDynamoDB, times(1)).shutdown();
    Mockito.verify(awsCredentialsProvider, times(1)).close();
}