@Test public void testFindByToken() { 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.findByToken("testtoken"); assertEquals(ct, result); }
public ClientToken findByToken(String token) { return ctd.findByToken(token); }
ClientTokenService { public ClientToken findByToken(String token) { return ctd.findByToken(token); } }
ClientTokenService { public ClientToken findByToken(String token) { return ctd.findByToken(token); }  }
ClientTokenService { public ClientToken findByToken(String token) { return ctd.findByToken(token); }  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 findByToken(String token) { return ctd.findByToken(token); }  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);  }