@Test public void testActionExecution() {

    // dummy up an ActionDefinition
    ActionDefinition.Builder actionDefinitionBuilder =
            ActionDefinition.Builder.create("myId", "myName", "myNamespace", "myTypeId", "myRuleId", 0);
    Map<String, String> attributes = new HashMap<String, String>();
    attributes.put(PeopleFlowActionTypeService.ATTRIBUTE_FIELD_NAME, VALID_PEOPLEFLOW_ID_1);
    attributes.put(PeopleFlowActionTypeService.NAME_ATTRIBUTE_FIELD, VALID_PEOPLEFLOW_NAME_1);
    actionDefinitionBuilder.setAttributes(attributes);
    // create an ExecutionEnvironment
    SelectionCriteria sc1 =
            SelectionCriteria.createCriteria(new DateTime(), Collections.<String, String>emptyMap(), Collections.singletonMap(
                    AgendaDefinition.Constants.EVENT, "foo"));
    ExecutionEnvironment ee = new BasicExecutionEnvironment(sc1, Collections.<Term, Object>emptyMap(), new ExecutionOptions(), new TermResolutionEngineImpl());
    // load a notification action
    Action notificationAction = notificationPFATS.loadAction(actionDefinitionBuilder.build());
    notificationAction.execute(ee);
    // change the peopleFlow id
    attributes.clear();
    attributes.put(PeopleFlowActionTypeService.ATTRIBUTE_FIELD_NAME, VALID_PEOPLEFLOW_ID_2);
    attributes.put(PeopleFlowActionTypeService.NAME_ATTRIBUTE_FIELD, VALID_PEOPLEFLOW_NAME_2);
    actionDefinitionBuilder.setAttributes(attributes);
    // load an approval action
    Action approvalAction = approvalPFATS.loadAction(actionDefinitionBuilder.build());
    approvalAction.execute(ee);
    // get our attribute for comparison
    String selectedPeopleFlows =
            (String)ee.getEngineResults().getAttribute(PeopleFlowActionTypeService.PEOPLE_FLOWS_SELECTED_ATTRIBUTE);
    // compare against our expected output:
    assertEquals("F:myBogusPeopleFlowId1,A:myBogusPeopleFlowId2", selectedPeopleFlows);
    String selectedPeopleName =
            (String)ee.getEngineResults().getAttribute(PeopleFlowActionTypeService.NAME_ATTRIBUTE_FIELD);
    // TODO: test ActionDefinition w/o the attribute we need
    actionDefinitionBuilder.setAttributes(Collections.<String, String>emptyMap());
    try {
        approvalPFATS.loadAction(actionDefinitionBuilder.build());
        fail("should have blown up since the attribute we need isn't in the ActionDefinition");
    } catch (RiceIllegalArgumentException e) {
        // good
    }
}