DefaultActionInvoker implements IActionInvoker { public void validate( final IAction actionBean, final String actionUser, final Map<String, Serializable> params ) throws ActionInvocationException { final String workItemName = ActionUtil.extractName( params ); if ( actionBean == null || params == null ) { final String failureMessage = Messages.getInstance().getCantInvokeNullAction(); WorkItemLifecycleEventUtil.publish( workItemName, params, WorkItemLifecyclePhase.FAILED, failureMessage ); throw new ActionInvocationException( failureMessage ); } if ( !isSupportedAction( actionBean ) ) { final String failureMessage = Messages.getInstance().getUnsupportedAction( actionBean.getClass().getName() ); WorkItemLifecycleEventUtil.publish( workItemName, params, WorkItemLifecyclePhase.FAILED, failureMessage ); throw new ActionInvocationException( failureMessage ); } }  void validate( final IAction actionBean, final String actionUser,
                        final Map<String, Serializable> params ); @Override IActionInvokeStatus invokeAction( final IAction actionBean,
                                           final String actionUser,
                                           final Map<String, Serializable> params ); @Override boolean isSupportedAction( IAction action );  }
@Test public void testValidate() throws Exception { final DefaultActionInvoker ai = new DefaultActionInvoker(); ai.validate( new TestAction(), "user", new HashMap() ); }
@Test( expected = ActionInvocationException.class ) public void testValidateNullAction() throws Exception { final DefaultActionInvoker ai = new DefaultActionInvoker(); ai.validate( null, "user", new HashMap() ); }
@Test( expected = ActionInvocationException.class ) public void testValidateNullParams() throws Exception { final DefaultActionInvoker ai = new DefaultActionInvoker(); ai.validate( new TestAction(), "user", null ); }