-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewriting tests #1787
Rewriting tests #1787
Conversation
szczygiel-m
commented
Nov 23, 2023
•
edited
edited
- TopicBlacklistTest
- UndeliveredLogTest
- PublishingWithFailoverTest
- KafkaSingleMessageReaderTest
- KafkaRetransmissionServiceTest
…n-tests-part1 # Conflicts: # integration-tests/src/common/java/pl/allegro/tech/hermes/integrationtests/client/ConsumerTestClient.java # integration-tests/src/common/java/pl/allegro/tech/hermes/integrationtests/client/HermesTestClient.java # integration-tests/src/common/java/pl/allegro/tech/hermes/integrationtests/setup/HermesConsumersTestApp.java # integration-tests/src/common/java/pl/allegro/tech/hermes/integrationtests/setup/HermesExtension.java
@@ -26,10 +30,13 @@ public HermesTestApp start() { | |||
"--consumer.healthCheckPort=0", | |||
"--consumer.kafka.namespace=itTest", | |||
"--consumer.kafka.clusters.[0].brokerList=" + kafka.getBootstrapServersForExternalClients(), | |||
"--consumer.kafka.clusters.[0].clusterName=" + "primary-dc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that in management configuration we have following configuration:
kafka.clusters[0].clusterName=primary
Won't it be a problem that there are two different values for management/consumers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually final configuration is the same, because management is building qualifiedClusterName with suffix containing dc name.
@Test | ||
public void shouldMoveOffsetNearGivenTimestamp() throws InterruptedException { | ||
// given | ||
TestSubscriber subscriber = subscribers.createSubscriber(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these "given" sections are quite long, what do you think about separating the different parts with empty lines to improve readability?
I wonder what you think about wrapping these two lines of code in some private method (just to make given section a bit smaller)?
publishMessagesAndWaitUntilReceived(String topicName, List<String> messages) { // Perhaps not the best name for this method
messages.forEach(message -> hermes.api().publish(topicName, message));
messages.forEach(subscriber::waitUntilReceived);
}
But both comments are probably a matter of preference so it is up to you 😄
23753a6
into
integration_tests_framework