@Test public void testExecuteWhenUnlocking() { final SetPersonLockedStatusRequest request = new SetPersonLockedStatusRequest(ACCOUNT_ID, false); context.checking(new Expectations() { { oneOf(setLockedStatusDAO).execute(request); allowing(personIdMapper).execute(ACCOUNT_ID); will(returnValue(PERSON_ID)); } }); TaskHandlerActionContext<ActionContext> outerActionContext = TestContextCreator .createTaskHandlerAsyncContext(request); sut.execute(outerActionContext); context.assertIsSatisfied(); assertEquals(1, outerActionContext.getUserActionRequests().size()); UserActionRequest outRequest = outerActionContext.getUserActionRequests().get(0); assertEquals("cachePerson", outRequest.getActionKey()); assertEquals(PERSON_ID, outRequest.getParams()); }
@Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { SetPersonLockedStatusRequest request = (SetPersonLockedStatusRequest) inActionContext.getActionContext() .getParams(); setLockedStatusDAO.execute(request); Long personId = personIdMapper.execute(request.getPersonAccountId()); if (request.getLockedStatus()) { inActionContext.getUserActionRequests().add( new UserActionRequest("deleteCacheKeysAction", null, (Serializable) Collections .singleton(CacheKeys.PERSON_BY_ID + personId))); } else { inActionContext.getUserActionRequests().add(new UserActionRequest("cachePerson", null, personId)); } return null; }
SetPersonLockedStatusExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { SetPersonLockedStatusRequest request = (SetPersonLockedStatusRequest) inActionContext.getActionContext() .getParams(); setLockedStatusDAO.execute(request); Long personId = personIdMapper.execute(request.getPersonAccountId()); if (request.getLockedStatus()) { inActionContext.getUserActionRequests().add( new UserActionRequest("deleteCacheKeysAction", null, (Serializable) Collections .singleton(CacheKeys.PERSON_BY_ID + personId))); } else { inActionContext.getUserActionRequests().add(new UserActionRequest("cachePerson", null, personId)); } return null; } }
SetPersonLockedStatusExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { SetPersonLockedStatusRequest request = (SetPersonLockedStatusRequest) inActionContext.getActionContext() .getParams(); setLockedStatusDAO.execute(request); Long personId = personIdMapper.execute(request.getPersonAccountId()); if (request.getLockedStatus()) { inActionContext.getUserActionRequests().add( new UserActionRequest("deleteCacheKeysAction", null, (Serializable) Collections .singleton(CacheKeys.PERSON_BY_ID + personId))); } else { inActionContext.getUserActionRequests().add(new UserActionRequest("cachePerson", null, personId)); } return null; } SetPersonLockedStatusExecution(final SetPersonLockedStatus inSetLockedStatusDAO,
            final DomainMapper<String, Long> inPersonIdMapper); }
SetPersonLockedStatusExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { SetPersonLockedStatusRequest request = (SetPersonLockedStatusRequest) inActionContext.getActionContext() .getParams(); setLockedStatusDAO.execute(request); Long personId = personIdMapper.execute(request.getPersonAccountId()); if (request.getLockedStatus()) { inActionContext.getUserActionRequests().add( new UserActionRequest("deleteCacheKeysAction", null, (Serializable) Collections .singleton(CacheKeys.PERSON_BY_ID + personId))); } else { inActionContext.getUserActionRequests().add(new UserActionRequest("cachePerson", null, personId)); } return null; } SetPersonLockedStatusExecution(final SetPersonLockedStatus inSetLockedStatusDAO,
            final DomainMapper<String, Long> inPersonIdMapper); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext); }
SetPersonLockedStatusExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext) { SetPersonLockedStatusRequest request = (SetPersonLockedStatusRequest) inActionContext.getActionContext() .getParams(); setLockedStatusDAO.execute(request); Long personId = personIdMapper.execute(request.getPersonAccountId()); if (request.getLockedStatus()) { inActionContext.getUserActionRequests().add( new UserActionRequest("deleteCacheKeysAction", null, (Serializable) Collections .singleton(CacheKeys.PERSON_BY_ID + personId))); } else { inActionContext.getUserActionRequests().add(new UserActionRequest("cachePerson", null, personId)); } return null; } SetPersonLockedStatusExecution(final SetPersonLockedStatus inSetLockedStatusDAO,
            final DomainMapper<String, Long> inPersonIdMapper); @Override Serializable execute(final TaskHandlerActionContext<ActionContext> inActionContext);  }