@Test
    void verifyGetSimpleCredentials() throws Throwable {
        val myNtlmUser = "DOMAIN\\Username";
        val myNtlmUserWithNoDomain = USERNAME;
        val myKerberosUser = "Username@DOMAIN.COM";

        val queue = new ArrayBlockingQueue<List<Authentication>>(POOL_SIZE);
        queue.add(CollectionUtils.wrapList(new MockJcifsAuthentication()));

        val factory = PrincipalFactoryUtils.newPrincipalFactory();
        val authenticationHandler = new JcifsSpnegoAuthenticationHandler(getProperties(true, true), null, null, queue);

        assertEquals(factory.createPrincipal(myNtlmUser), authenticationHandler.getPrincipal(myNtlmUser, true));
        assertEquals(factory.createPrincipal(myNtlmUserWithNoDomain), authenticationHandler.getPrincipal(myNtlmUserWithNoDomain, false));
        assertEquals(factory.createPrincipal(myKerberosUser), authenticationHandler.getPrincipal(myKerberosUser, false));

        val handlerNoDomain = new JcifsSpnegoAuthenticationHandler(getProperties(false, true), mock(ServicesManager.class),
            PrincipalFactoryUtils.newPrincipalFactory(), queue);
        assertEquals(factory.createPrincipal(USERNAME), handlerNoDomain.getPrincipal(myNtlmUser, true));
        assertEquals(factory.createPrincipal(USERNAME), handlerNoDomain.getPrincipal(myNtlmUserWithNoDomain, true));
        assertEquals(factory.createPrincipal(USERNAME), handlerNoDomain.getPrincipal(myKerberosUser, false));
    }
@author Marc-Antoine Garrigue
@author Arnaud Lesueur
@since 4.2.0
support/cas-server-support-spnego/src/test/java/org/apereo/cas/support/spnego/authentication/handler/support/JcifsSpnegoAuthenticationHandlerTests.java