Skip to content
Snippets Groups Projects
Commit 2a509fec authored by Lukas Malte Monnerjahn's avatar Lukas Malte Monnerjahn
Browse files

test XtaService::fetchMessages uses processMessage

parent 28482731
Branches
Tags
1 merge request!5Kop 2694 xta client lib verwenden
Pipeline #2060 skipped
...@@ -27,6 +27,7 @@ import java.util.Collection; ...@@ -27,6 +27,7 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.function.Consumer;
import lombok.NonNull; import lombok.NonNull;
import lombok.SneakyThrows; import lombok.SneakyThrows;
...@@ -59,6 +60,8 @@ class XtaService { ...@@ -59,6 +60,8 @@ class XtaService {
static final String FIM_MESSAGE_TYPE_PREFIX = "fim."; static final String FIM_MESSAGE_TYPE_PREFIX = "fim.";
final Consumer<XtaMessage> MESSAGE_PROCESSOR = this::processMessage;
@Autowired @Autowired
private XtaClient xtaClient; private XtaClient xtaClient;
@Autowired @Autowired
...@@ -76,7 +79,8 @@ class XtaService { ...@@ -76,7 +79,8 @@ class XtaService {
@SneakyThrows @SneakyThrows
public void fetchMessages() { public void fetchMessages() {
var transportReports = xtaClient.fetchMessages(this::processMessage);
var transportReports = xtaClient.fetchMessages(MESSAGE_PROCESSOR);
logTransportReports(transportReports); logTransportReports(transportReports);
} }
......
...@@ -94,10 +94,10 @@ class XtaServiceTest { ...@@ -94,10 +94,10 @@ class XtaServiceTest {
@Test @Test
@SneakyThrows @SneakyThrows
void shouldCallXtaClient() { void shouldUseMessageProcessor() {
service.fetchMessages(); service.fetchMessages();
verify(xtaClient).fetchMessages(any()); verify(xtaClient).fetchMessages(service.MESSAGE_PROCESSOR);
} }
@Test @Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment