@Test
public void testIsValidAuthorizedServiceTokenValidSvcToken() {

    // testing valid service token - we have multiple cases
    // to consider:
    // single service entry in list + service name
    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=svc1;bs=signature";
    PrincipalToken svcToken = new PrincipalToken(token);
    StringBuilder errMsg = new StringBuilder();
    assertTrue(svcToken.isValidAuthorizedServiceToken(errMsg));
    // single service entry in list + no service name
    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;bs=signature";
    svcToken = new PrincipalToken(token);
    assertTrue(svcToken.isValidAuthorizedServiceToken(null));
    // multiple service entries in list + service name
    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=svc1;bs=signature";
    svcToken = new PrincipalToken(token);
    assertTrue(svcToken.isValidAuthorizedServiceToken(errMsg));
}