@Test
public void testIsValidAuthorizedServiceTokenUnknownSvc() {

    // we're going to test where we have both service name
    // and signature but the service name is not in the
    // service list (single entry)
    String token = "v=S1;d=domain;n=service;t=1234;e=1235;k=0;h=host1;i=1.2.3.4;b=svc1;s=signature;bk=0;bn=svc3;bs=signature";
    PrincipalToken svcToken = new PrincipalToken(token);
    StringBuilder errMsg = new StringBuilder();
    assertFalse(svcToken.isValidAuthorizedServiceToken(errMsg));
    assertTrue(!errMsg.toString().isEmpty());
    // service list (multiple entries)
    token = "v=S1;d=domain;n=service;t=1234;e=1235;k=0;h=host1;i=1.2.3.4;b=svc1,svc2;s=signature;bk=0;bn=svc3;bs=signature";
    svcToken = new PrincipalToken(token);
    errMsg = new StringBuilder();
    assertFalse(svcToken.isValidAuthorizedServiceToken(errMsg));
    assertTrue(!errMsg.toString().isEmpty());
}