@Test public final void testNullResult() { context.checking(new Expectations() { { oneOf(taskHandlerActionContextMock).getActionContext(); will(returnValue(serviceActionContextMock)); oneOf(serviceActionContextMock).getParams(); will(returnValue(userAcctId)); oneOf(ldapPersonMapper).findPeople(userAcctId, 1); will(returnValue(null)); } }); Person result = sut.execute(taskHandlerActionContextMock); assertNull(result); context.assertIsSatisfied(); }
@Override public Person execute(final TaskHandlerActionContext<ActionContext> inActionContext) { String userId = (String) inActionContext.getActionContext().getParams(); Assert.notNull(userId); List<Person> results = ldapPersonMapper.findPeople(userId, 1); if (results == null || results.size() == 0) { return null; } Person person = results.get(0); person.setAccountLocked(true); Person newPerson = (Person) new InlineExecutionStrategyExecutor().execute(createPersonStrategy, new CreatePersonRequest(person, false), inActionContext); return newPerson; }
CreatePersonFromLdapExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Person execute(final TaskHandlerActionContext<ActionContext> inActionContext) { String userId = (String) inActionContext.getActionContext().getParams(); Assert.notNull(userId); List<Person> results = ldapPersonMapper.findPeople(userId, 1); if (results == null || results.size() == 0) { return null; } Person person = results.get(0); person.setAccountLocked(true); Person newPerson = (Person) new InlineExecutionStrategyExecutor().execute(createPersonStrategy, new CreatePersonRequest(person, false), inActionContext); return newPerson; } }
CreatePersonFromLdapExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Person execute(final TaskHandlerActionContext<ActionContext> inActionContext) { String userId = (String) inActionContext.getActionContext().getParams(); Assert.notNull(userId); List<Person> results = ldapPersonMapper.findPeople(userId, 1); if (results == null || results.size() == 0) { return null; } Person person = results.get(0); person.setAccountLocked(true); Person newPerson = (Person) new InlineExecutionStrategyExecutor().execute(createPersonStrategy, new CreatePersonRequest(person, false), inActionContext); return newPerson; } CreatePersonFromLdapExecution(final PersonLookupStrategy inLdapPersonMapper,
            final TaskHandlerExecutionStrategy<ActionContext> inCreatePersonStrategy); }
CreatePersonFromLdapExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Person execute(final TaskHandlerActionContext<ActionContext> inActionContext) { String userId = (String) inActionContext.getActionContext().getParams(); Assert.notNull(userId); List<Person> results = ldapPersonMapper.findPeople(userId, 1); if (results == null || results.size() == 0) { return null; } Person person = results.get(0); person.setAccountLocked(true); Person newPerson = (Person) new InlineExecutionStrategyExecutor().execute(createPersonStrategy, new CreatePersonRequest(person, false), inActionContext); return newPerson; } CreatePersonFromLdapExecution(final PersonLookupStrategy inLdapPersonMapper,
            final TaskHandlerExecutionStrategy<ActionContext> inCreatePersonStrategy); @Override Person execute(final TaskHandlerActionContext<ActionContext> inActionContext); }
CreatePersonFromLdapExecution implements TaskHandlerExecutionStrategy<ActionContext> { @Override public Person execute(final TaskHandlerActionContext<ActionContext> inActionContext) { String userId = (String) inActionContext.getActionContext().getParams(); Assert.notNull(userId); List<Person> results = ldapPersonMapper.findPeople(userId, 1); if (results == null || results.size() == 0) { return null; } Person person = results.get(0); person.setAccountLocked(true); Person newPerson = (Person) new InlineExecutionStrategyExecutor().execute(createPersonStrategy, new CreatePersonRequest(person, false), inActionContext); return newPerson; } CreatePersonFromLdapExecution(final PersonLookupStrategy inLdapPersonMapper,
            final TaskHandlerExecutionStrategy<ActionContext> inCreatePersonStrategy); @Override Person execute(final TaskHandlerActionContext<ActionContext> inActionContext);  }