Skip to content
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

Bump lib.testcontainers.version from 1.18.3 to 1.19.6 #594

Merged
merged 4 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<lib.parallel-consumer.version>0.5.2.8</lib.parallel-consumer.version>
<lib.pebble.version>3.2.2</lib.pebble.version>
<lib.protobuf-java.version>3.25.3</lib.protobuf-java.version>
<lib.testcontainers.version>1.18.3</lib.testcontainers.version>
<lib.testcontainers.version>1.19.6</lib.testcontainers.version>
<lib.resilience4j.version>2.2.0</lib.resilience4j.version>
<lib.system-rules.version>1.19.0</lib.system-rules.version>
<lib.versatile.version>0.4.1</lib.versatile.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void testSingleRecordProcessorRetry() throws Exception {
processorManager.startAll();

await("Record Processing")
.atMost(Duration.ofSeconds(5))
.atMost(Duration.ofSeconds(15))
.untilAsserted(() -> assertThat(attemptsCounter).hasValue(4));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
Expand Down Expand Up @@ -105,7 +106,8 @@ public void shouldSendBomProcessedNotification() throws Exception {
assertThat(kafka.readValues(ReadKeyValues
.from(KafkaTopics.NOTIFICATION_BOM.name(), String.class, Notification.class)
.with(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class)
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class))
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class)
.withMaxTotalPollTime(5, TimeUnit.SECONDS))
).satisfiesExactly(
notification -> {
final BomConsumedOrProcessedSubject subject =
Expand All @@ -132,7 +134,8 @@ public void shouldSendBomProcessedNotification() throws Exception {
assertThat(kafka.readValues(ReadKeyValues
.from(KafkaTopics.NOTIFICATION_PROJECT_VULN_ANALYSIS_COMPLETE.name(), String.class, Notification.class)
.with(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class)
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class))
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class)
.withMaxTotalPollTime(5, TimeUnit.SECONDS))
).satisfiesExactly(
notification -> {
final ProjectVulnAnalysisCompleteSubject subject =
Expand Down Expand Up @@ -203,7 +206,8 @@ public void shouldNotSendBomProcessedNotificationWhenWorkflowHasNoCompletedBomPr
assertThat(kafka.readValues(ReadKeyValues
.from(KafkaTopics.NOTIFICATION_PROJECT_VULN_ANALYSIS_COMPLETE.name(), String.class, Notification.class)
.with(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class)
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class))
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class)
.withMaxTotalPollTime(5, TimeUnit.SECONDS))
).satisfiesExactly(
notification -> {
final ProjectVulnAnalysisCompleteSubject subject =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import java.time.Duration;
import java.util.function.Supplier;

import static org.dependencytrack.assertion.Assertions.assertConditionWithTimeout;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

abstract class KafkaStreamsTest extends PersistenceCapableTest {

Expand Down Expand Up @@ -75,7 +76,14 @@ public void before() throws Exception {
kafkaStreams = new KafkaStreams(topologySupplier.get(), streamsConfig);
kafkaStreams.start();

assertConditionWithTimeout(() -> KafkaStreams.State.RUNNING == kafkaStreams.state(), Duration.ofSeconds(5));
await("Kafka Streams Readiness")
.atMost(Duration.ofSeconds(15))
.failFast(() -> assertThat(kafkaStreams.state()).isNotIn(
KafkaStreams.State.ERROR,
KafkaStreams.State.PENDING_ERROR,
KafkaStreams.State.PENDING_SHUTDOWN
))
.untilAsserted(() -> assertThat(kafkaStreams.state()).isEqualTo(KafkaStreams.State.RUNNING));
}

@After
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import static java.util.stream.Collectors.joining;
Expand Down Expand Up @@ -241,7 +242,8 @@ public void vulnScanResultProcessingTest() throws Exception {
assertThat(kafka.readValues(ReadKeyValues
.from(KafkaTopics.NOTIFICATION_PROJECT_VULN_ANALYSIS_COMPLETE.name(), String.class, Notification.class)
.with(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class)
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class))
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class)
.withMaxTotalPollTime(5, TimeUnit.SECONDS))
).satisfiesExactly(
notification -> {
final ProjectVulnAnalysisCompleteSubject subject =
Expand Down Expand Up @@ -405,7 +407,8 @@ public void vulnScanFailureTest() throws Exception {
assertThat(kafka.readValues(ReadKeyValues
.from(KafkaTopics.NOTIFICATION_PROJECT_VULN_ANALYSIS_COMPLETE.name(), String.class, Notification.class)
.with(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class)
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class))
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class)
.withMaxTotalPollTime(5, TimeUnit.SECONDS))
).satisfiesExactly(
notification -> {
final ProjectVulnAnalysisCompleteSubject subject =
Expand Down Expand Up @@ -560,8 +563,10 @@ public void projectVulnAnalysisCompleteNotificationFailureTest() throws Exceptio
// Verify that no notification was sent.
final List<Notification> notifications = kafka.readValues(ReadKeyValues
.from(KafkaTopics.NOTIFICATION_PROJECT_VULN_ANALYSIS_COMPLETE.name(), String.class, Notification.class)
.with(ConsumerConfig.GROUP_ID_CONFIG, "foo")
.with(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class)
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class));
.with(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, NotificationDeserializer.class)
.withMaxTotalPollTime(5, TimeUnit.SECONDS));
assertThat(notifications).isEmpty();

// Ensure that Kafka Streams did not terminate due to project not existing.
Expand Down
Loading