public void testInjectResourceToActions() throws Exception {
// add he resource to the resource registry
resourceRegistry.putResource(MessageStore.class, Mockito.mock(MessageStore.class));
Processor processor = Mockito.mock(Processor.class);
ConnectorService processorService = new MockConnectorService("test", processor, resourceRegistry);
// test inject resource to pre-processing action
MockAction action = new MockAction();
processorService.addPreProcessingAction(action);
Assert.assertNotNull(action.getMessageStore());
// test inject resource to post-processing action
action = new MockAction();
processorService.addPostProcessingAction(action);
Assert.assertNotNull(action.getMessageStore());
// test inject resource to post-receiving action
action = new MockAction();
processorService.addPostReceivingAction(action);
Assert.assertNotNull(action.getMessageStore());
}