@Test public void shoudlGetAccount() { User bob = UserTestUtils.createBob(); Account checkings = AccountTestUtils.createCheckingsAccount(bob); when(accountRepositoryMock.findOne(isA(Example.class))).thenReturn(Optional.of(checkings)); Account accounts = testSubject.get(checkings.getId()); assertThat(accounts).isEqualTo(checkings); }
public Account get(long id) { return accountRepository.findOne(Example.of(new Account().setId(id))).orElse(null); }
AccountService { public Account get(long id) { return accountRepository.findOne(Example.of(new Account().setId(id))).orElse(null); } }
AccountService { public Account get(long id) { return accountRepository.findOne(Example.of(new Account().setId(id))).orElse(null); } @Autowired  AccountService(AccountRepository accountRepository, UserRepository userRepository); }
AccountService { public Account get(long id) { return accountRepository.findOne(Example.of(new Account().setId(id))).orElse(null); } @Autowired  AccountService(AccountRepository accountRepository, UserRepository userRepository); List<Account> list(long userId); Account get(long id); Account create(long userId, String description, boolean onBudget); }
AccountService { public Account get(long id) { return accountRepository.findOne(Example.of(new Account().setId(id))).orElse(null); } @Autowired  AccountService(AccountRepository accountRepository, UserRepository userRepository); List<Account> list(long userId); Account get(long id); Account create(long userId, String description, boolean onBudget);  }