@Test public void shouldReturnAllUser() throws Exception { final List<User> bobAndJane = UserTestUtils.createBobAndJane(); when(userRepositoryMock.findAll()).thenReturn(bobAndJane); final List<User> list = testSubject.list(); assertThat(list).isEqualTo(bobAndJane); }
public List<User> list() { return userRepository.findAll(); }
UserService { public List<User> list() { return userRepository.findAll(); } }
UserService { public List<User> list() { return userRepository.findAll(); } @Autowired  UserService(UserRepository userRepository, UserManagementProperties userManagementProperties); }
UserService { public List<User> list() { return userRepository.findAll(); } @Autowired  UserService(UserRepository userRepository, UserManagementProperties userManagementProperties); List<User> list(); User create(String name, String currency); User get(long id); String getTestProperty(); }
UserService { public List<User> list() { return userRepository.findAll(); } @Autowired  UserService(UserRepository userRepository, UserManagementProperties userManagementProperties); List<User> list(); User create(String name, String currency); User get(long id); String getTestProperty();  }