@Test public void findUsersByUsername() { final Users users = usersJdbcRepository.findUsersByUsername("abc"); assertNull(users); }
@Override public Users findUsersByUsername(String username) { final Cache usersCache = getUsersCache(); final String key = generateUsersKey(username); Users users = (Users) getFromCache(usersCache, key); if (users == null) { users = usersRepository.findUsersByUsername(username); putToCache(usersCache, key, users); LOG.debug("Load Users[{}] from DB and cache it, key = {}", users, key); } return users; }
UsersRSRedisRepository extends AbstractCacheSupport implements UsersRepository { @Override public Users findUsersByUsername(String username) { final Cache usersCache = getUsersCache(); final String key = generateUsersKey(username); Users users = (Users) getFromCache(usersCache, key); if (users == null) { users = usersRepository.findUsersByUsername(username); putToCache(usersCache, key, users); LOG.debug("Load Users[{}] from DB and cache it, key = {}", users, key); } return users; } }
UsersRSRedisRepository extends AbstractCacheSupport implements UsersRepository { @Override public Users findUsersByUsername(String username) { final Cache usersCache = getUsersCache(); final String key = generateUsersKey(username); Users users = (Users) getFromCache(usersCache, key); if (users == null) { users = usersRepository.findUsersByUsername(username); putToCache(usersCache, key, users); LOG.debug("Load Users[{}] from DB and cache it, key = {}", users, key); } return users; }  }
UsersRSRedisRepository extends AbstractCacheSupport implements UsersRepository { @Override public Users findUsersByUsername(String username) { final Cache usersCache = getUsersCache(); final String key = generateUsersKey(username); Users users = (Users) getFromCache(usersCache, key); if (users == null) { users = usersRepository.findUsersByUsername(username); putToCache(usersCache, key, users); LOG.debug("Load Users[{}] from DB and cache it, key = {}", users, key); } return users; }  @Override Users findUsersByUsername(String username); @Override List<Roles> findRolesByUsername(String username); }
UsersRSRedisRepository extends AbstractCacheSupport implements UsersRepository { @Override public Users findUsersByUsername(String username) { final Cache usersCache = getUsersCache(); final String key = generateUsersKey(username); Users users = (Users) getFromCache(usersCache, key); if (users == null) { users = usersRepository.findUsersByUsername(username); putToCache(usersCache, key, users); LOG.debug("Load Users[{}] from DB and cache it, key = {}", users, key); } return users; }  @Override Users findUsersByUsername(String username); @Override List<Roles> findRolesByUsername(String username);  }