@Test public void testDisplayName() throws Exception { UserInfo userInfo = new UserInfo(FOO, BAR); assertUserInfo(userInfo, FOO, BAR, null); userInfo.setDisplayName(MR_FOO); assertUserInfo(userInfo, FOO, BAR, MR_FOO); userInfo.setDisplayName(null); assertUserInfo(userInfo, FOO, BAR, null); }
@Test public void testEquals() throws Exception { assertTrue(USER.equals(USER)); assertFalse(USER.equals(USER_DIFFERENT_NAME)); assertFalse(USER_DIFFERENT_NAME.equals(USER)); assertFalse(USER.equals(USER_DIFFERENT_EMAIL)); assertFalse(USER_DIFFERENT_EMAIL.equals(USER)); assertTrue(USER.equals(USER_DISPLAYNAME)); assertTrue(USER_DISPLAYNAME.equals(USER)); assertFalse(USER.equals(null)); assertFalse(USER.equals(MR_FOO)); }