3738394041424344
@Test public void testGetUserById(){ when(userDao.getUserById(USER_ID)).thenReturn(user); when(user.getId()).thenReturn(USER_ID); User tempUser = userService.getUserById(USER_ID); assertEquals(USER_ID, tempUser.getId()); }
4344454647484950
assertEquals(USER_ID, tempUser.getId()); } @Test public void testGetUserByNegativeId(){ User tempUser = userService.getUserById(NEGATIVE_USER_ID); assertNull(tempUser); }