@@ -0,0 +1,979 @@
+/*%0A * Copyright 2005 The JA-SIG Collaborative. All rights reserved. See license%0A * distributed with this file and available online at%0A * http://www.uportal.org/license.html%0A */%0Apackage org.jasig.cas.adaptors.spnego.authentication.principal;%0A%0Aimport org.jasig.cas.authentication.principal.Principal;%0Aimport org.jasig.cas.authentication.principal.SimplePrincipal;%0A%0Aimport junit.framework.TestCase;%0A%0A%0Apublic class SpnegoCredentialsTests extends TestCase %7B%0A%0A    %0A    public void testToStringWithNoPrincipal() %7B%0A        final SpnegoCredentials credentials = new SpnegoCredentials(new byte%5B%5D %7B%7D);%0A        %0A        assertTrue(credentials.toString().indexOf(%22null%22) != -1);%0A    %7D%0A    %0A    public void testToStringWithPrincipal() %7B%0A        final SpnegoCredentials credentials = new SpnegoCredentials(new byte%5B%5D %7B%7D);%0A        final Principal principal = new SimplePrincipal(%22test%22);%0A        credentials.setPrincipal(principal);%0A        assertEquals(%22test%22, credentials.toString());%0A    %7D%0A%7D%0A

test cases