### Question:
UserService { public User read(int id) { return userDao.read(id); }  User registrate(String name, String password); User signIn(String name, String password); User read(int id); void update(User user); void delete(int id); void setUserDao(UserDao userDao); List<User> readAll();  }### Answer:
@Test void readTest() { int id = 42; String name = "name"; String password = "password"; int gamesPlayed = 42; int gamesWon = 10; User user = new User(name, password); user.setId(id); user.setGamesPlayed(gamesPlayed); user.setGamesWon(10); when(entityManager.find(User.class, user.getId())).thenReturn(user); User result = userService.read(id); Assertions.assertEquals(id, result.getId()); Assertions.assertEquals(name, result.getName()); Assertions.assertEquals(password, result.getPassword()); Assertions.assertEquals(gamesPlayed, result.getGamesPlayed()); Assertions.assertEquals(gamesWon, result.getGamesWon()); }