I want to start a selftest after spring-integration is started. My first approach was to start it after the setup of the integration flow:
@Configuration
@EnableIntegration
@EnableIntegrationManagement
@IntegrationComponentScan
public class FlowConfig {
...
@PostConstruct
public void startSelfTest() {
SelfTest selfTest = new SelfTest(rezeptConfig, dataSource, archiveClient);
selfTest.run();
}
...
}
This does not work because when the test was started the tables in the database were missing because liquibase was not yet started. I guess the liquibase scripts would be started after initialization.
Any ideas what is the best place to start a selftest?