@Test public final void executeTest() { final Long personId = 2L; final Long scopeId = 3L; context.checking(new Expectations() { { oneOf(actionContext).getPrincipal(); will(returnValue(principal)); oneOf(principal).getId(); will(returnValue(personId)); allowing(actionContext).getParams(); will(returnValue(scopeId)); oneOf(insertMapper).execute(with(any(PersistenceRequest.class))); } }); sut.execute(actionContext); context.assertIsSatisfied(); }
public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { Long ssIdToInsert = (Long) inActionContext.getParams(); PersonBlockedSuggestion blockedSuggestion = new PersonBlockedSuggestion(ssIdToInsert, inActionContext .getPrincipal().getId()); insertMapper.execute(new PersistenceRequest<PersonBlockedSuggestion>(blockedSuggestion)); return null; }
InsertStreamBlockedSuggestionExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { Long ssIdToInsert = (Long) inActionContext.getParams(); PersonBlockedSuggestion blockedSuggestion = new PersonBlockedSuggestion(ssIdToInsert, inActionContext .getPrincipal().getId()); insertMapper.execute(new PersistenceRequest<PersonBlockedSuggestion>(blockedSuggestion)); return null; } }
InsertStreamBlockedSuggestionExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { Long ssIdToInsert = (Long) inActionContext.getParams(); PersonBlockedSuggestion blockedSuggestion = new PersonBlockedSuggestion(ssIdToInsert, inActionContext .getPrincipal().getId()); insertMapper.execute(new PersistenceRequest<PersonBlockedSuggestion>(blockedSuggestion)); return null; } InsertStreamBlockedSuggestionExecution(final InsertMapper<PersonBlockedSuggestion> inInsertMapper); }
InsertStreamBlockedSuggestionExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { Long ssIdToInsert = (Long) inActionContext.getParams(); PersonBlockedSuggestion blockedSuggestion = new PersonBlockedSuggestion(ssIdToInsert, inActionContext .getPrincipal().getId()); insertMapper.execute(new PersistenceRequest<PersonBlockedSuggestion>(blockedSuggestion)); return null; } InsertStreamBlockedSuggestionExecution(final InsertMapper<PersonBlockedSuggestion> inInsertMapper); Serializable execute(final PrincipalActionContext inActionContext); }
InsertStreamBlockedSuggestionExecution implements ExecutionStrategy<PrincipalActionContext> { public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException { Long ssIdToInsert = (Long) inActionContext.getParams(); PersonBlockedSuggestion blockedSuggestion = new PersonBlockedSuggestion(ssIdToInsert, inActionContext .getPrincipal().getId()); insertMapper.execute(new PersistenceRequest<PersonBlockedSuggestion>(blockedSuggestion)); return null; } InsertStreamBlockedSuggestionExecution(final InsertMapper<PersonBlockedSuggestion> inInsertMapper); Serializable execute(final PrincipalActionContext inActionContext);  }