I have a switchyard route built in java that that calls helper beans which do things like validating the request, setting some exchange properties etc. I now want to mock these beans in my test cases to ensure that my camel flow goes down the right logical path
My camel route looks like
from(switchyard:/<xxxxx>).
.bean(builder.class, "method")
.choice()
.when ( flag) // This flag is built in the "method" of the builder class)
xxx logic
.otherwise()
yyy logic
endChoide()
In my test case i want to mock the builder.class and set the flag to true ( and make sure xxx is executed ) and false ( to ensure yyy is executed ). Any ideas how to accomplish this would be of great help
Venu
Hi,
You can create an instance of builder.class in src/test/java that will hide the one in src/main/java, so it will be used in the JUnit tests.