0 Replies Latest reply on Oct 6, 2009 7:23 AM by lpiccoli.lucio.asteriski.com

    how to mock JBPM @endtask

    lpiccoli.lucio.asteriski.com

      hi all


      i am attempting to test an action method annotated with @EndTask using SeamTest.




       @EndTask()
        public String accept(){
        log.debug("...................accept {0}", signoff);
      
        //do stuff         
        return Constant.TASK_MANAGER_FORM;
      }
      



      i dont want/or need to do a entire jbpm lifecyle test, just test the action method itself.


      however without having the process definition deployed, created and started the action method is not being invoked and my tests fails. I MEAN THE METHOD DOES NOT GET INVOKED AS NO DEBUG OR BRREAKPOINTS FIRE.
      If i remove the @EndTask annotation the method is invoked.


       @Override
      protected void invokeApplication() throws Exception
      {     
         assertNotNull( invokeAction("#{InspectionSignOffForm.accept}") );
      }
      



      i have tried using an easyMock taskinstance to coerce it into working but no joy.


      Q. How can i test an action method with an @EndTask annotation, without doing an entire jbpm lifecycle?


      -lp