@Test public void testFindByEmail() { ClientToken ct = newInstence(); User user = ct.getUser(); us.save(user); assertThat(user.getId(), not(0)); cts.save(ct); assertThat(ct.getId(), not(0)); ClientToken result = cts.findByEmail(user.getEmail()); assertEquals(ct, result); }
public ClientToken findByEmail(String email) { return ctd.findByUId(us.findByEmail(email).getId()); }
ClientTokenService { public ClientToken findByEmail(String email) { return ctd.findByUId(us.findByEmail(email).getId()); } }
ClientTokenService { public ClientToken findByEmail(String email) { return ctd.findByUId(us.findByEmail(email).getId()); }  }
ClientTokenService { public ClientToken findByEmail(String email) { return ctd.findByUId(us.findByEmail(email).getId()); }  ClientToken findByEmail(String email); @Transactional(propagation = Propagation.REQUIRED) void save(ClientToken ct); ClientToken findByToken(String token); boolean checkTokenBelongToUser(String token, int u_id); boolean checkTokenBelongToUser(String token, String email); }
ClientTokenService { public ClientToken findByEmail(String email) { return ctd.findByUId(us.findByEmail(email).getId()); }  ClientToken findByEmail(String email); @Transactional(propagation = Propagation.REQUIRED) void save(ClientToken ct); ClientToken findByToken(String token); boolean checkTokenBelongToUser(String token, int u_id); boolean checkTokenBelongToUser(String token, String email);  }