Skip to content

Commit

Permalink
Closes #612: fix autoconfiguration for taskana-adapter-camunda-outbox…
Browse files Browse the repository at this point in the history
…-rest
  • Loading branch information
arolfes committed Nov 27, 2023
1 parent 4291f6f commit cbffdfc
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pro.taskana.adapter.camunda.outbox.rest.spring.boot.starter.config.OutboxRestServiceAutoConfiguration
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit cbffdfc

Please sign in to comment.