web services - Spring Integration WS: mock Endpoint to return response -


i have setup spring integration flow configuration send messages external web service , unmarshalling response , doing post processing based on response object type.

i have following outbound-gateway configuration:

<int:channel id="sendrequestchannel"/> <ws:outbound-gateway request-channel="sendrequestchannel" uri="${send.ws.uri}" reply-channel="responsetransformer" >     <ws:request-handler-advice-chain>         <ref bean="retryadviceuserupdatews" />     </ws:request-handler-advice-chain> </ws:outbound-gateway> 

now, want test flow , check correct post processing triggered based on response object.

is there anyway in integration test mock endpoint response based on message i'm sending?

actually should understand part of flow better mock , return desired response.

  1. you can inject channelinterceptor sendrequestchannel presend returns null, prevent further process , send message desired response responsetransformer.

  2. another powerful option add 1 more advice <ws:request-handler-advice-chain> , implement extension of abstractrequesthandleradvice.

  3. and last option see via java code mock webservicetemplate.sendandreceive , inject <ws:outbound-gateway>.

  4. from other side know soapui has tool mock target service, so, don't need in java, unless tests.

so, choose proper way test flow.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -

html - href attribute breaking an element -