I was trying to run some sql scripts before my Spring-boot integration tests,
I refered this solution and placed my sql script at the root level in resources folder (i.e. src/integrationTest/resources)
Cucumber Test stepDef class src/integrationTest/java/steps/StepDefinitions.java
@Sql(scripts = "clean-up.sql", executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD)
public class StepDefinitions {
..
clean-up.sql
delete from my_table where id in ('FOP678A090839984D04BA76E07DEB7C58BC', 'FOP678A090839984D04BA76E07DEB7C5811');
commit;
However nothing deleted from my PostgreSQL after running Spring-boot integration tests
@Sqlannotation on the@CucumberSpringContextannotated class. Upgrade Cucumber if you don't have that annotation.@Sql(scripts = "classpath:clean-up.sql"...to add the file in integrationTest resources folder.