@Test public void transform() { final Long id = 7L; JSONObject request = new JSONObject(); request.put("followedBy", "shawkings"); context.checking(new Expectations() { { oneOf(getPersonIdByAccountIdMapper).execute("shawkings"); will(returnValue(id)); } }); Long result = sut.transform(request, 0L); context.assertIsSatisfied(); assertEquals(id, result); }
@Override public Long transform(final JSONObject request, final Long userEntityId) { String accountId = request.getString("followedBy"); if (log.isTraceEnabled()) { log.trace("Looking for cache key for activities followed by " + accountId); } return getPersonIdByAccountIdMapper.execute(accountId); }
FollowedByPersistenceRequestTransformer implements PersistenceDataSourceRequestTransformer { @Override public Long transform(final JSONObject request, final Long userEntityId) { String accountId = request.getString("followedBy"); if (log.isTraceEnabled()) { log.trace("Looking for cache key for activities followed by " + accountId); } return getPersonIdByAccountIdMapper.execute(accountId); } }
FollowedByPersistenceRequestTransformer implements PersistenceDataSourceRequestTransformer { @Override public Long transform(final JSONObject request, final Long userEntityId) { String accountId = request.getString("followedBy"); if (log.isTraceEnabled()) { log.trace("Looking for cache key for activities followed by " + accountId); } return getPersonIdByAccountIdMapper.execute(accountId); } FollowedByPersistenceRequestTransformer(final DomainMapper<String, Long> inGetPersonIdByAccountIdMapper); }
FollowedByPersistenceRequestTransformer implements PersistenceDataSourceRequestTransformer { @Override public Long transform(final JSONObject request, final Long userEntityId) { String accountId = request.getString("followedBy"); if (log.isTraceEnabled()) { log.trace("Looking for cache key for activities followed by " + accountId); } return getPersonIdByAccountIdMapper.execute(accountId); } FollowedByPersistenceRequestTransformer(final DomainMapper<String, Long> inGetPersonIdByAccountIdMapper); @Override Long transform(final JSONObject request, final Long userEntityId); }
FollowedByPersistenceRequestTransformer implements PersistenceDataSourceRequestTransformer { @Override public Long transform(final JSONObject request, final Long userEntityId) { String accountId = request.getString("followedBy"); if (log.isTraceEnabled()) { log.trace("Looking for cache key for activities followed by " + accountId); } return getPersonIdByAccountIdMapper.execute(accountId); } FollowedByPersistenceRequestTransformer(final DomainMapper<String, Long> inGetPersonIdByAccountIdMapper); @Override Long transform(final JSONObject request, final Long userEntityId);  }