@Test public final void testGet() { final Person testPerson = context.mock(Person.class); userActionRequests = new ArrayList<UserActionRequest>(); context.checking(new Expectations() { { allowing(taskHandlerActionContext).getUserActionRequests(); will(returnValue(userActionRequests)); oneOf(personMapperMock).findByAccountId("accountid"); will(returnValue(testPerson)); allowing(testPerson).getDisplayName(); will(returnValue("displayName")); } }); Map<String, Serializable> fields = new HashMap<String, Serializable>(); fields.put("accountId", "accountid"); sut.get(null, fields); }
public Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields) { Person p = personMapper.findByAccountId((String) inFields.get("accountId")); inFields.put(ORIGINAL_DISPLAY_NAME_KEY, p.getDisplayName()); return p; }
PersonUpdater implements ResourcePersistenceStrategy<Person> { public Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields) { Person p = personMapper.findByAccountId((String) inFields.get("accountId")); inFields.put(ORIGINAL_DISPLAY_NAME_KEY, p.getDisplayName()); return p; } }
PersonUpdater implements ResourcePersistenceStrategy<Person> { public Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields) { Person p = personMapper.findByAccountId((String) inFields.get("accountId")); inFields.put(ORIGINAL_DISPLAY_NAME_KEY, p.getDisplayName()); return p; } PersonUpdater(final PersonMapper inPersonMapper, final CacheUpdater inPersonActivityCacheUpdater); }
PersonUpdater implements ResourcePersistenceStrategy<Person> { public Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields) { Person p = personMapper.findByAccountId((String) inFields.get("accountId")); inFields.put(ORIGINAL_DISPLAY_NAME_KEY, p.getDisplayName()); return p; } PersonUpdater(final PersonMapper inPersonMapper, final CacheUpdater inPersonActivityCacheUpdater); Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields); void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields, final Person inUpdatedPerson); }
PersonUpdater implements ResourcePersistenceStrategy<Person> { public Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields) { Person p = personMapper.findByAccountId((String) inFields.get("accountId")); inFields.put(ORIGINAL_DISPLAY_NAME_KEY, p.getDisplayName()); return p; } PersonUpdater(final PersonMapper inPersonMapper, final CacheUpdater inPersonActivityCacheUpdater); Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields); void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields, final Person inUpdatedPerson); static final String ORIGINAL_PARENT_ORG_KEY; }