Hi all,

I'm writing service tests, in the same way as what's done in ProductPromoCondTests.groovy. I load same data, then start a service using dispatcher.runSync, and finally, check my database state.

I would like to be able to test services that are launched with runAsync in my codebase. For now I can only check that the service is scheduled (checking JobSandbox), but I guess that my test ends before the async service is started (and I'm not even sure how to wait for a spawn thread in my test).

I tried to replace "runAsync" calls by "runSync" using Mockito's spy() and doAnswer, but I could not achieve what I need (I'm certainly missing something here).

Has anyone ever encountered this need and could share a solution ?

Beside this, I would like to be able to run on specific test with CLI. For now I launch

./gradlew 'ofbiz -t component=stock -t suitename=stockTests -t case=stockTests'

...which runs all the tests in StockTests.groovy class. Is it possible to update this command to run only one test in this class ?

Thank you

Reply via email to