use of org.eclipse.milo.opcua.stack.core.types.structured.AnonymousIdentityToken in project milo by eclipse.
the class AnonymousProviderTest method testGetIdentityToken_EmptyPolicyId.
@Test
public void testGetIdentityToken_EmptyPolicyId() throws Exception {
EndpointDescription endpoint = new EndpointDescription(null, null, null, null, null, new UserTokenPolicy[] { new UserTokenPolicy("", UserTokenType.Anonymous, null, null, null) }, null, null);
AnonymousProvider p = new AnonymousProvider();
SignedIdentityToken signedIdentityToken = p.getIdentityToken(endpoint, ByteString.NULL_VALUE);
assertEquals(signedIdentityToken.getToken().getPolicyId(), "");
assertTrue(signedIdentityToken.getToken() instanceof AnonymousIdentityToken);
}
use of org.eclipse.milo.opcua.stack.core.types.structured.AnonymousIdentityToken in project milo by eclipse.
the class AnonymousProviderTest method testGetIdentityToken.
@Test
public void testGetIdentityToken() throws Exception {
EndpointDescription endpoint = new EndpointDescription(null, null, null, null, null, new UserTokenPolicy[] { new UserTokenPolicy("anonymous", UserTokenType.Anonymous, null, null, null) }, null, null);
AnonymousProvider p = new AnonymousProvider();
SignedIdentityToken signedIdentityToken = p.getIdentityToken(endpoint, ByteString.NULL_VALUE);
assertEquals(signedIdentityToken.getToken().getPolicyId(), "anonymous");
assertTrue(signedIdentityToken.getToken() instanceof AnonymousIdentityToken);
}
use of org.eclipse.milo.opcua.stack.core.types.structured.AnonymousIdentityToken in project milo by eclipse.
the class AnonymousProviderTest method testGetIdentityToken_NullPolicyId.
@Test
public void testGetIdentityToken_NullPolicyId() throws Exception {
EndpointDescription endpoint = new EndpointDescription(null, null, null, null, null, new UserTokenPolicy[] { new UserTokenPolicy(null, UserTokenType.Anonymous, null, null, null) }, null, null);
AnonymousProvider p = new AnonymousProvider();
SignedIdentityToken signedIdentityToken = p.getIdentityToken(endpoint, ByteString.NULL_VALUE);
assertNull(signedIdentityToken.getToken().getPolicyId());
assertTrue(signedIdentityToken.getToken() instanceof AnonymousIdentityToken);
}
Aggregations