    @Test
    public void testNullPrincipal()
    {

        context.checking(new Expectations()
        {
            {
                oneOf(securityContext).getAuthentication();
                will(returnValue(authentication));

                oneOf(authentication).getPrincipal();
                will(returnValue(null));
            }
        });

        assertNull(runTest(true));
    }