Skip to content

Commit

Permalink
feat: grouping configuration together
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Dec 22, 2023
1 parent 932e967 commit 42ef358
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -25,9 +23,6 @@ class OrderModuleTests {
@MockBean
KafkaOperations<?, ?> kafkaOperations;

@MockBean
ApplicationProperties applicationProperties;

@Autowired
OrderService orders;

Expand All @@ -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"));
Expand Down

0 comments on commit 42ef358

Please sign in to comment.