use of org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal in project activemq-artemis by apache.
the class UserPrincipalTest method testHash.
@Test
public void testHash() {
UserPrincipal p1 = new UserPrincipal("FOO");
UserPrincipal p2 = new UserPrincipal("FOO");
assertEquals(p1.hashCode(), p1.hashCode());
assertEquals(p1.hashCode(), p2.hashCode());
}
use of org.apache.activemq.artemis.spi.core.security.jaas.UserPrincipal in project activemq-artemis by apache.
the class UserPrincipalTest method testEquals.
@Test
public void testEquals() {
UserPrincipal p1 = new UserPrincipal("FOO");
UserPrincipal p2 = new UserPrincipal("FOO");
UserPrincipal p3 = new UserPrincipal("BAR");
assertTrue(p1.equals(p1));
assertTrue(p1.equals(p2));
assertFalse(p1.equals(null));
assertFalse(p1.equals("FOO"));
assertFalse(p1.equals(p3));
}
Aggregations