'Jbehave story ran before all beans get initialized

we use Jbehave framework for functional test, the test took long time to start up, as it has lots of beans to initialize. one thing we noticed was that before all beans are ready, the test already started running, which cause some issue, in the test it published message to kafka and expected to receive that message, because kafka was not ready yet so the test failed. how can I force the Jbehave test wait until all beans are ready then run?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source