1
votes

I am using "int-jdbc:stored-proc-outbound-gateway" in spring integration to get the details from the 11i stored procedure by directly hitting db using the datasource.

Now, I creating a Junit for the spring integration and need to mock the response as similar to the stored procedure result but hitting actual db.

Plz tell me achieve this scenario in the spring integration ?

Thanks in Adavance .

1

1 Answers

0
votes

You can mock the StoredProcExcecutor which is constructor-injected into the gateway. The gateway invokes the executeStoredProcedure(Message<?> message) method.

If you are using Java configuration, you can simply inject the mock; if you are using XML, it's a bit more tricky, but you can use a DirectFieldAccessor to replace the SPE with a mock.