Skip to content
Snippets Groups Projects
Commit 3c607b47 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

OZG-6891 XtaClientITCase: Remove potentially flaky tests

parent 8bcc8068
No related branches found
No related tags found
No related merge requests found
...@@ -220,48 +220,6 @@ class XtaClientITCase { ...@@ -220,48 +220,6 @@ class XtaClientITCase {
); );
} }
@DisplayName("should close messages only if no exception occurs during processing, with no exception for author2")
@Test
void shouldCloseMessagesOnlyIfNoExceptionOccursDuringProcessingWithNoExceptionForAuthor2() {
setupClientWithIdentifiers(List.of(READER_CLIENT_IDENTIFIER1, READER_CLIENT_IDENTIFIER2, READER_CLIENT_IDENTIFIER3));
processMessageDummy = message -> throwRuntimeExceptionExceptForAuthorIdentifier(message, AUTHOR_CLIENT_IDENTIFIER2);
var transportReports = fetchMessages();
if (hasLogLineContaining(NO_MESSAGE_CLOSED_WARNING)) {
// The first listing for reader2 contained sendMessages.get(1) and sendMessages.get(2).
// Since no messages have been closed for this listing, no second listing for reader2 is attempted.
// Therefore, sendMessages.get(3) was not fetched.
assertThat(supportCheckedMetadataItems).hasSize(1 + 2 + 2);
assertThatMessages(processedMessages).containExactlyInAnyOrder(
sendMessages.get(0),
sendMessages.get(1), sendMessages.get(2),
sendMessages.get(4), sendMessages.get(5)
);
assertThatTransportReports(transportReports)
.reportExactlyFor(processedMessages)
.haveExactlyGreenStatusFor(
messageIdBySendIndex(4)
);
} else {
// The first listing for reader2 contained sendMessages.get(3).
assertThat(supportCheckedMetadataItems).hasSize(1 + 3 + 2);
assertThatMessages(processedMessages).containExactlyInAnyOrder(
sendMessages.get(0),
sendMessages.get(1), sendMessages.get(2), sendMessages.get(3),
sendMessages.get(4), sendMessages.get(5)
);
assertThatTransportReports(transportReports)
.reportExactlyFor(processedMessages)
.haveExactlyGreenStatusFor(
messageIdBySendIndex(3),
messageIdBySendIndex(4)
);
}
}
@DisplayName("should close messages only if no exception occurs during processing, with no exception for author3") @DisplayName("should close messages only if no exception occurs during processing, with no exception for author3")
@Test @Test
void shouldCloseMessagesOnlyIfNoExceptionOccursDuringProcessingWithNoExceptionForAuthor3() { void shouldCloseMessagesOnlyIfNoExceptionOccursDuringProcessingWithNoExceptionForAuthor3() {
...@@ -308,32 +266,6 @@ class XtaClientITCase { ...@@ -308,32 +266,6 @@ class XtaClientITCase {
.haveExactlyGreenStatusFor(messageIdBySendIndex(0), messageIdBySendIndex(1), messageIdBySendIndex(2)); .haveExactlyGreenStatusFor(messageIdBySendIndex(0), messageIdBySendIndex(1), messageIdBySendIndex(2));
} }
@DisplayName("should process messages only if supported, with support for author2")
@Test
void shouldProcessMessagesOnlyIfSupportedWithSupportForAuthor2() {
setupClientWithIdentifiers(List.of(READER_CLIENT_IDENTIFIER1, READER_CLIENT_IDENTIFIER2, READER_CLIENT_IDENTIFIER3));
isSupportedDummy = metaData -> metaData.authorIdentifier().value().equals(AUTHOR_CLIENT_IDENTIFIER2.value());
var transportReports = fetchMessages();
if (hasLogLineContaining(NO_MESSAGE_CLOSED_WARNING)) {
// Case: sendMessages.get(3) was not fetched.
assertThat(supportCheckedMetadataItems).hasSize(1 + 2 + 2);
assertThatMessages(processedMessages).containExactlyInAnyOrder(sendMessages.get(4));
assertThatTransportReports(transportReports)
.reportExactlyFor(processedMessages)
.haveExactlyGreenStatusFor(messageIdBySendIndex(4));
} else {
// Case: sendMessages.get(3) was fetched.
assertThat(supportCheckedMetadataItems).hasSize(1 + 3 + 2);
assertThatMessages(processedMessages).containExactlyInAnyOrder(sendMessages.get(3), sendMessages.get(4));
assertThatTransportReports(transportReports)
.reportExactlyFor(processedMessages)
.haveExactlyGreenStatusFor(messageIdBySendIndex(3), messageIdBySendIndex(4));
}
}
@DisplayName("should process messages only if supported, with support for author3") @DisplayName("should process messages only if supported, with support for author3")
@Test @Test
void shouldProcessMessagesOnlyIfSupportedWithSupportForAuthor3() { void shouldProcessMessagesOnlyIfSupportedWithSupportForAuthor3() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment