@Test public void testTransformLongResult() { context.checking(new Expectations() { { allowing(actionContext).getParams(); will(returnValue("aaa")); allowing(mapper).fetchId("aaa"); will(returnValue(5L)); } }); assertEquals(5L, sut.transform(actionContext)); context.assertIsSatisfied(); }
@Override public Serializable transform(final ActionContext inActionContext) { return returnValueAsString ? keyToIdMapper.fetchId((String) inActionContext.getParams()).toString() : keyToIdMapper.fetchId((String) inActionContext.getParams()); }
EntityIdFromUniqueStringKeyParameter implements RequestTransformer { @Override public Serializable transform(final ActionContext inActionContext) { return returnValueAsString ? keyToIdMapper.fetchId((String) inActionContext.getParams()).toString() : keyToIdMapper.fetchId((String) inActionContext.getParams()); } }
EntityIdFromUniqueStringKeyParameter implements RequestTransformer { @Override public Serializable transform(final ActionContext inActionContext) { return returnValueAsString ? keyToIdMapper.fetchId((String) inActionContext.getParams()).toString() : keyToIdMapper.fetchId((String) inActionContext.getParams()); } EntityIdFromUniqueStringKeyParameter(final GetItemsByPointerIds inKeyToIdMapper); }
EntityIdFromUniqueStringKeyParameter implements RequestTransformer { @Override public Serializable transform(final ActionContext inActionContext) { return returnValueAsString ? keyToIdMapper.fetchId((String) inActionContext.getParams()).toString() : keyToIdMapper.fetchId((String) inActionContext.getParams()); } EntityIdFromUniqueStringKeyParameter(final GetItemsByPointerIds inKeyToIdMapper); @Override Serializable transform(final ActionContext inActionContext); void setReturnValueAsString(final Boolean inReturnValueAsString); }
EntityIdFromUniqueStringKeyParameter implements RequestTransformer { @Override public Serializable transform(final ActionContext inActionContext) { return returnValueAsString ? keyToIdMapper.fetchId((String) inActionContext.getParams()).toString() : keyToIdMapper.fetchId((String) inActionContext.getParams()); } EntityIdFromUniqueStringKeyParameter(final GetItemsByPointerIds inKeyToIdMapper); @Override Serializable transform(final ActionContext inActionContext); void setReturnValueAsString(final Boolean inReturnValueAsString);  }