@Test public void testGetPersistentLoginDataSuccess() { final PersistentLoginMapper loginMapper = context.mock(PersistentLoginMapper.class); final PersistentLogin login = context.mock(PersistentLogin.class); context.checking(new Expectations() { { oneOf(loginMapper).findByAccountId(with("theuser")); will(returnValue(login)); } }); PersistentLoginRepositoryImpl sut = new PersistentLoginRepositoryImpl(loginMapper); assertNotNull("Did not return PersistentLogin retreived from DB", sut.getPersistentLogin("theuser")); context.assertIsSatisfied(); }
public PersistentLogin getPersistentLogin(final String username) { try { return loginMapper.findByAccountId(username); } catch (Exception e) { logger.error("Error loading persistent login information for: " + username, e); return null; } }
PersistentLoginRepositoryImpl implements PersistentLoginRepository { public PersistentLogin getPersistentLogin(final String username) { try { return loginMapper.findByAccountId(username); } catch (Exception e) { logger.error("Error loading persistent login information for: " + username, e); return null; } } }
PersistentLoginRepositoryImpl implements PersistentLoginRepository { public PersistentLogin getPersistentLogin(final String username) { try { return loginMapper.findByAccountId(username); } catch (Exception e) { logger.error("Error loading persistent login information for: " + username, e); return null; } } PersistentLoginRepositoryImpl(final PersistentLoginMapper inLoginMapper); }
PersistentLoginRepositoryImpl implements PersistentLoginRepository { public PersistentLogin getPersistentLogin(final String username) { try { return loginMapper.findByAccountId(username); } catch (Exception e) { logger.error("Error loading persistent login information for: " + username, e); return null; } } PersistentLoginRepositoryImpl(final PersistentLoginMapper inLoginMapper); @Transactional void createOrUpdatePersistentLogin(final PersistentLogin persistentLogin); PersistentLogin getPersistentLogin(final String username); @Transactional void removePersistentLogin(final String username); }
PersistentLoginRepositoryImpl implements PersistentLoginRepository { public PersistentLogin getPersistentLogin(final String username) { try { return loginMapper.findByAccountId(username); } catch (Exception e) { logger.error("Error loading persistent login information for: " + username, e); return null; } } PersistentLoginRepositoryImpl(final PersistentLoginMapper inLoginMapper); @Transactional void createOrUpdatePersistentLogin(final PersistentLogin persistentLogin); PersistentLogin getPersistentLogin(final String username); @Transactional void removePersistentLogin(final String username);  }