@Test public void testExecute() { SingleValueCacheMapper sut = new SingleValueCacheMapper<String, String>("PREFIX:", keySuffixTransformer); sut.setCache(cache); context.checking(new Expectations() { { oneOf(keySuffixTransformer).transform("SUFFIX"); will(returnValue("FOO")); oneOf(cache).get("PREFIX:FOO"); will(returnValue("RESULT")); } }); assertEquals("RESULT", sut.execute("SUFFIX")); context.assertIsSatisfied(); }
public CachedValueType execute(final KeySuffixType inKeySuffix) { String cacheKey = cacheKeyPrefix + keySuffixTransformer.transform(inKeySuffix); return (CachedValueType) getCache().get(cacheKey); }
SingleValueCacheMapper extends CachedDomainMapper implements
        DomainMapper<KeySuffixType, CachedValueType> { public CachedValueType execute(final KeySuffixType inKeySuffix) { String cacheKey = cacheKeyPrefix + keySuffixTransformer.transform(inKeySuffix); return (CachedValueType) getCache().get(cacheKey); } }
SingleValueCacheMapper extends CachedDomainMapper implements
        DomainMapper<KeySuffixType, CachedValueType> { public CachedValueType execute(final KeySuffixType inKeySuffix) { String cacheKey = cacheKeyPrefix + keySuffixTransformer.transform(inKeySuffix); return (CachedValueType) getCache().get(cacheKey); } SingleValueCacheMapper(final String inCacheKeyPrefix,
            final Transformer<KeySuffixType, String> inKeySuffixTransformer); }
SingleValueCacheMapper extends CachedDomainMapper implements
        DomainMapper<KeySuffixType, CachedValueType> { public CachedValueType execute(final KeySuffixType inKeySuffix) { String cacheKey = cacheKeyPrefix + keySuffixTransformer.transform(inKeySuffix); return (CachedValueType) getCache().get(cacheKey); } SingleValueCacheMapper(final String inCacheKeyPrefix,
            final Transformer<KeySuffixType, String> inKeySuffixTransformer); CachedValueType execute(final KeySuffixType inKeySuffix); }
SingleValueCacheMapper extends CachedDomainMapper implements
        DomainMapper<KeySuffixType, CachedValueType> { public CachedValueType execute(final KeySuffixType inKeySuffix) { String cacheKey = cacheKeyPrefix + keySuffixTransformer.transform(inKeySuffix); return (CachedValueType) getCache().get(cacheKey); } SingleValueCacheMapper(final String inCacheKeyPrefix,
            final Transformer<KeySuffixType, String> inKeySuffixTransformer); CachedValueType execute(final KeySuffixType inKeySuffix);  }