diff --git a/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java b/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java new file mode 100644 index 00000000..76572a45 --- /dev/null +++ b/service/src/main/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfig.java @@ -0,0 +1,30 @@ +package org.folio.rest.workflow.config; + +import org.folio.spring.liquibase.FolioSpringLiquibase; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Provide custom overrides to FOLIO Spring Support Liquibase related configuration. + */ +@Configuration +public class FolioSpringLiquibaseConfig { + + /** + * Enable liquibase to work-around problems where FolioSpringLiquibase requires it but it causes problems and workflow doesn't use it. + * + * Specifically disable running using configuration. + * Cannot return NULL to designate don't use because folio-spring-support doesn't verify the beans existence. + * + * @return + */ + @Bean + FolioSpringLiquibase folioSpringLiquibase() { + final FolioSpringLiquibase folioSpringLiquibase = new FolioSpringLiquibase(); + + folioSpringLiquibase.setShouldRun(false); + + return folioSpringLiquibase; + } + +} diff --git a/service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java b/service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java new file mode 100644 index 00000000..ff00235c --- /dev/null +++ b/service/src/test/java/org/folio/rest/workflow/config/FolioSpringLiquibaseConfigTest.java @@ -0,0 +1,21 @@ +package org.folio.rest.workflow.config; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest(classes = FolioSpringLiquibaseConfig.class) +class FolioSpringLiquibaseConfigTest { + + @Autowired + private FolioSpringLiquibaseConfig folioSpringLiquibaseConfig; + + @Test + void testFolioSpringLiquibaseConfigBeanExists() { + + assertNotNull(folioSpringLiquibaseConfig); + } + +}