@Test
public void testValidateForAuthorizedServiceNoSignature() throws CryptoException {

    long issueTime = System.currentTimeMillis() / 1000;
    // Create and sign token
    List<String> authorizedServices = new ArrayList<>();
    authorizedServices.add("coretech.storage");
    PrincipalToken userTokenToSign = new PrincipalToken.Builder(usrVersion, usrDomain, usrName)
        .salt(salt).issueTime(issueTime).expirationWindow(expirationTime)
        .authorizedServices(authorizedServices).build();
    userTokenToSign.sign(servicePrivateKeyStringK0);
    // Create a token for validation using the signed data without
    // signing for authorized service so there won't be bs field.
    PrincipalToken userTokenToValidate = new PrincipalToken(userTokenToSign.getSignedToken());
    StringBuilder errMsg = new StringBuilder();
    assertFalse(userTokenToValidate.validateForAuthorizedService(servicePublicKeyStringK1, errMsg));
    assertTrue(!errMsg.toString().isEmpty());
}