@Test
public void testTokenWithExtraArgsAfterSignature() {

    PrincipalToken token = new PrincipalToken("v=S1;d=coretech;n=service;t=1234;e=1235;k=0;h=host1;i=1.2.3.4;b=svc1;s=signature;d=domain2;n=api");
    assertEquals(token.getDomain(), "coretech");
    assertEquals(token.getVersion(), "S1");
    assertEquals(token.getName(), "service");
    assertEquals(token.getSignature(), "signature;d=domain2;n=api");
    assertEquals(token.getUnsignedToken(), "v=S1;d=coretech;n=service;t=1234;e=1235;k=0;h=host1;i=1.2.3.4;b=svc1");
    token = new PrincipalToken("v=S1;d=coretech;n=service;t=1234;e=1235;k=0;h=host1;i=1.2.3.4;b=svc1;s=signature;d=domain2;n=api;bs=svc-signature;d=domain2;n=api");
    assertEquals(token.getDomain(), "coretech");
    assertEquals(token.getVersion(), "S1");
    assertEquals(token.getName(), "service");
    assertEquals(token.getSignature(), "signature");
    assertEquals(token.getUnsignedToken(), "v=S1;d=coretech;n=service;t=1234;e=1235;k=0;h=host1;i=1.2.3.4;b=svc1");
}