ffang commented on pull request #2524:
URL: https://github.com/apache/camel-quarkus/pull/2524#issuecomment-828651360


   > Asside from the `LraTestResource` mods, I'm a bit confused by the changes 
to this test.
   > 
   > The general idea is that `CreditService` has a limit of 100 credits. The 
test then makes 3 'orders' amounting to 95 credits. It then attempts another 
order with a total of 20 to trigger the 'Insufficient Credit' scenario. So from 
what I can see, the assertions are valid and correct (I think I stole this idea 
from the Camel main project BTW).
   
   OK, now I understand better about the testcase.
   
   So the "java.lang.IllegalStateException: Insufficient credit" is expected, 
but this test still has the logic error.
   Since it always creates new orders before checking the credit, so when 
checking valid order, the expected return value is 4 instead of 3. I adjusted 
the camel route definition(put checking credit before creating new order) to 
make the test pass.
   
   Actually this problem also exists in the test 
counterpart(LRACreditIT#testCreditExhausted)  of camel-lra component, so I 
think we also need a change in camel project.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to