java - Testing the Execution order of handlers injected by Spring Framework -


i'm using spring framework inject several dependency code, , 1 of beans this

<bean id="handlerchain" class="com.abc.chainhelper">     <property name="handlers">         <list>             <bean class="com.abc.authenticationhandler" />             <bean class="com.abc.handler1" />             <ref bean="handler2" />         </list>     </property> </bean> 

chainhelper takes list of handlers , executes process every handler in order given. have unit test in chainhelper ensure chainhelper processes every handler in order given. however, in current project i'm working on, handler1 should processed when authenticationhandler finishes authenticating job.

authenticationhandler this

public class authenticationhandler extends abstracthandler {     //variable declarations , constructor      @override     public void process(job job) throws throwable {         //some code verify identity of job         job.isverified = verificationresult;     }      //some helper methods } 

and handler1 this

public class handler1 extends abstracthandler {     //variable declarations , constructor      @override     public void process(job job) throws throwable {         if (job.isverified) {             //do verified job stuff         } else {             //do unverified job stuff         }     }      //some helper methods } 

so want write test enforce no 1 accidentally change order in list , break everything.

this seems big unit test, since i'm testing order of execution of multiple handlers , not individual piece of code. however, don't feel big enough integration test. reason way understood integration test tests specific request valid , invalid input, , make sure getting correct result based on input, , dependency injected on every types of request, doesn't quite fit integration tests.

so question how should go testing execution order of particular injection?


Comments