@Test public void testTransform() { final long userId = 123L; UsePrincipalPersonIdRequestTransformer sut = new UsePrincipalPersonIdRequestTransformer(); context.checking(new Expectations() { { oneOf(actionContext).getPrincipal(); will(returnValue(principal)); oneOf(principal).getId(); will(returnValue(userId)); } }); Serializable result = sut.transform(actionContext); context.assertIsSatisfied(); assertEquals(userId, result); }
@Override public Serializable transform(final PrincipalActionContext inActionContext) { return inActionContext.getPrincipal().getId(); }
UsePrincipalPersonIdRequestTransformer implements Transformer<PrincipalActionContext, Serializable> { @Override public Serializable transform(final PrincipalActionContext inActionContext) { return inActionContext.getPrincipal().getId(); } }
UsePrincipalPersonIdRequestTransformer implements Transformer<PrincipalActionContext, Serializable> { @Override public Serializable transform(final PrincipalActionContext inActionContext) { return inActionContext.getPrincipal().getId(); }  }
UsePrincipalPersonIdRequestTransformer implements Transformer<PrincipalActionContext, Serializable> { @Override public Serializable transform(final PrincipalActionContext inActionContext) { return inActionContext.getPrincipal().getId(); }  @Override Serializable transform(final PrincipalActionContext inActionContext); }
UsePrincipalPersonIdRequestTransformer implements Transformer<PrincipalActionContext, Serializable> { @Override public Serializable transform(final PrincipalActionContext inActionContext) { return inActionContext.getPrincipal().getId(); }  @Override Serializable transform(final PrincipalActionContext inActionContext);  }