@Test
public void testAssertException()
{

    AutoRefreshCredentialProvider autoRefreshCredentialProvider = new AutoRefreshCredentialProvider()
    {
        @Override
        public AwsCredential getNewAwsCredential() throws Exception
        {
            throw new Exception("test");
        }
    };
    try
    {
        executeWithoutLogging(AutoRefreshCredentialProvider.class, () -> {
            autoRefreshCredentialProvider.getAwsCredential();
        });
        fail();
    }
    catch (Exception e)
    {
        assertEquals(IllegalStateException.class, e.getClass());
        Throwable cause = e.getCause();
        assertEquals(Exception.class, cause.getClass());
        assertEquals("test", cause.getMessage());
    }
}