diff --git a/kafka-sample/spring-modulith-outbox-pattern/src/main/java/com/example/outboxpattern/ExternalizationConfiguration.java b/kafka-sample/spring-modulith-outbox-pattern/src/main/java/com/example/outboxpattern/config/ExternalizationConfiguration.java similarity index 94% rename from kafka-sample/spring-modulith-outbox-pattern/src/main/java/com/example/outboxpattern/ExternalizationConfiguration.java rename to kafka-sample/spring-modulith-outbox-pattern/src/main/java/com/example/outboxpattern/config/ExternalizationConfiguration.java index cff2bde6..c03b221a 100644 --- a/kafka-sample/spring-modulith-outbox-pattern/src/main/java/com/example/outboxpattern/ExternalizationConfiguration.java +++ b/kafka-sample/spring-modulith-outbox-pattern/src/main/java/com/example/outboxpattern/config/ExternalizationConfiguration.java @@ -1,6 +1,5 @@ -package com.example.outboxpattern; +package com.example.outboxpattern.config; -import com.example.outboxpattern.config.ApplicationProperties; import com.example.outboxpattern.order.OrderResponse; import jakarta.annotation.PostConstruct; import lombok.RequiredArgsConstructor; diff --git a/kafka-sample/spring-modulith-outbox-pattern/src/test/java/com/example/outboxpattern/order/internal/OrderModuleTests.java b/kafka-sample/spring-modulith-outbox-pattern/src/test/java/com/example/outboxpattern/order/internal/OrderModuleTests.java index b8b6e96c..304b88d8 100644 --- a/kafka-sample/spring-modulith-outbox-pattern/src/test/java/com/example/outboxpattern/order/internal/OrderModuleTests.java +++ b/kafka-sample/spring-modulith-outbox-pattern/src/test/java/com/example/outboxpattern/order/internal/OrderModuleTests.java @@ -2,10 +2,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.when; -import com.example.outboxpattern.config.ApplicationProperties; import com.example.outboxpattern.order.OrderResponse; import com.example.outboxpattern.order.internal.request.OrderRequest; import java.util.concurrent.CompletableFuture; @@ -25,9 +23,6 @@ class OrderModuleTests { @MockBean KafkaOperations kafkaOperations; - @MockBean - ApplicationProperties applicationProperties; - @Autowired OrderService orders; @@ -43,8 +38,6 @@ void shouldTriggerOrderCreatedEvent(Scenario scenario) { return CompletableFuture.completedFuture(new SendResult<>(null, null)); }); - given(applicationProperties.getOrderCreatedKafkaTopic()).willReturn("order-created"); - scenario.stimulate(() -> orders.saveOrder(new OrderRequest("Coffee"))) .andWaitForEventOfType(OrderResponse.class) .toArriveAndVerify(event -> assertThat(event.product()).isEqualTo("Coffee"));