### Question:
UserService { @Transactional(readOnly = true) public UserResponse getUser(Integer userId) { final Optional<TestUser> user = userRepository.findById(userId); return user.map(UserService::toUserResponse).orElseThrow(NotFoundException::new); } @Inject  UserService(UserRepository userRepository); @Transactional(readOnly = true) UserResponse getUser(Integer userId);  }### Answer:
@Test void getUser() { final UserResponse user = userService.getUser(2); assertEquals(Integer.valueOf(2), user.getId()); assertEquals("John Doe", user.getName()); }