@Test
public void testGetSessionTokenProviderRefreshWhileNotLoggedIn() throws Exception {

    try {
        Configuration conf = TestingTools.getBrokerConfig();
        getSessionToken(conf);
        fail();
    } catch (Exception e) {
        assertEquals(RuntimeException.class, e.getClass());
        Assert.assertEquals(
            "Failed creating a SPNEGO token. Make sure that you have run kinit and that your Kerberos configuration is correct. See the full Kerberos error message: " + SpnegoUtilsTest.TGT_ERROR,
            e.getMessage()
        );
    }
}