diff --git a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml index 18cb4c01..b1beb532 100644 --- a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml +++ b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml @@ -34,8 +34,8 @@ spring-boot-starter-web - org.postgresql - postgresql + org.springframework.boot + spring-boot-starter-test test diff --git a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/main/resources/META-INF/spring.factories b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/main/resources/META-INF/spring.factories deleted file mode 100644 index ed184dc4..00000000 --- a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=pro.taskana.adapter.camunda.outbox.rest.spring.boot.starter.config.OutboxRestServiceAutoConfiguration \ No newline at end of file diff --git a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports new file mode 100644 index 00000000..39d39581 --- /dev/null +++ b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -0,0 +1 @@ +pro.taskana.adapter.camunda.outbox.rest.spring.boot.starter.config.OutboxRestServiceAutoConfiguration \ No newline at end of file diff --git a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/test/java/pro/taskana/adapter/camunda/outbox/rest/spring/boot/starter/config/OutboxRestServiceAutoConfigurationTest.java b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/test/java/pro/taskana/adapter/camunda/outbox/rest/spring/boot/starter/config/OutboxRestServiceAutoConfigurationTest.java new file mode 100644 index 00000000..a5be3aeb --- /dev/null +++ b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/src/test/java/pro/taskana/adapter/camunda/outbox/rest/spring/boot/starter/config/OutboxRestServiceAutoConfigurationTest.java @@ -0,0 +1,53 @@ +package pro.taskana.adapter.camunda.outbox.rest.spring.boot.starter.config; + +import static org.assertj.core.api.Assertions.assertThat; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.context.annotation.Configuration; +import pro.taskana.adapter.camunda.outbox.rest.config.OutboxRestServiceConfig; +import pro.taskana.adapter.camunda.outbox.rest.controller.CamundaTaskEventsController; +import pro.taskana.adapter.camunda.parselistener.TaskanaParseListenerProcessEnginePlugin; + +@SpringBootTest +class OutboxRestServiceAutoConfigurationTest { + + private final OutboxRestServiceConfig outboxRestServiceConfig; + + private final CamundaTaskEventsController camundaTaskEventsController; + + private final TaskanaParseListenerProcessEnginePlugin taskanaParseListenerProcessEnginePlugin; + + OutboxRestServiceAutoConfigurationTest( + @Autowired(required = false) OutboxRestServiceConfig outboxRestServiceConfig, + @Autowired(required = false) CamundaTaskEventsController camundaTaskEventsController, + @Autowired(required = false) + TaskanaParseListenerProcessEnginePlugin taskanaParseListenerProcessEnginePlugin) { + this.outboxRestServiceConfig = outboxRestServiceConfig; + this.camundaTaskEventsController = camundaTaskEventsController; + this.taskanaParseListenerProcessEnginePlugin = taskanaParseListenerProcessEnginePlugin; + } + + @Test + void outboxRestServiceConfig_is_automatically_configured() { + assertThat(outboxRestServiceConfig).isNotNull(); + } + + @Test + void camundaTaskEventsController_is_automatically_configured() { + assertThat(outboxRestServiceConfig).isNotNull(); + } + + @Test + void taskanaParseListenerProcessEnginePlugin_is_automatically_configured() { + assertThat(outboxRestServiceConfig).isNotNull(); + } + + @Configuration + @EnableAutoConfiguration + static class TestConfig { + // empty class to enable AutoConfiguration and configure spring boot test for it + } +}