use of org.apache.nifi.authorization.user.StandardNiFiUser in project nifi by apache.
the class X509AuthenticationProviderTest method testShouldCreateAnonymousUser.
@Test
public void testShouldCreateAnonymousUser() {
// Arrange
String identity = "someone";
// Act
NiFiUser user = X509AuthenticationProvider.createUser(identity, null, null, null, true);
// Assert
assert user != null;
assert user instanceof StandardNiFiUser;
assert user.getIdentity().equals(StandardNiFiUser.ANONYMOUS_IDENTITY);
assert user.isAnonymous();
}
use of org.apache.nifi.authorization.user.StandardNiFiUser in project nifi by apache.
the class X509AuthenticationProviderTest method testShouldCreateKnownUser.
@Test
public void testShouldCreateKnownUser() {
// Arrange
String identity = "someone";
// Act
NiFiUser user = X509AuthenticationProvider.createUser(identity, null, null, null, false);
// Assert
assert user != null;
assert user instanceof StandardNiFiUser;
assert user.getIdentity().equals(identity);
assert !user.isAnonymous();
}
Aggregations