-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Remove unused @ClassRule container in KafkaContainerTest and use cp-kafka:6.2.1 as default
#4564
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,6 @@ | ||
| package org.testcontainers.containers; | ||
|
|
||
| import static java.util.Collections.singletonList; | ||
| import static org.assertj.core.api.Assertions.assertThat; | ||
| import static org.assertj.core.api.Assertions.tuple; | ||
|
|
||
| import com.google.common.collect.ImmutableMap; | ||
| import java.time.Duration; | ||
| import java.util.Collection; | ||
| import java.util.UUID; | ||
| import java.util.concurrent.TimeUnit; | ||
| import org.apache.kafka.clients.admin.AdminClient; | ||
| import org.apache.kafka.clients.admin.AdminClientConfig; | ||
| import org.apache.kafka.clients.admin.NewTopic; | ||
|
|
@@ -21,22 +13,25 @@ | |
| import org.apache.kafka.clients.producer.ProducerRecord; | ||
| import org.apache.kafka.common.serialization.StringDeserializer; | ||
| import org.apache.kafka.common.serialization.StringSerializer; | ||
| import org.junit.ClassRule; | ||
| import org.junit.Test; | ||
| import org.rnorth.ducttape.unreliables.Unreliables; | ||
| import org.testcontainers.Testcontainers; | ||
| import org.testcontainers.utility.DockerImageName; | ||
|
|
||
| import java.time.Duration; | ||
| import java.util.Collection; | ||
| import java.util.UUID; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import static java.util.Collections.singletonList; | ||
| import static org.assertj.core.api.Assertions.assertThat; | ||
| import static org.assertj.core.api.Assertions.tuple; | ||
|
|
||
| public class KafkaContainerTest { | ||
|
|
||
| private static final DockerImageName KAFKA_TEST_IMAGE = DockerImageName.parse("confluentinc/cp-kafka:5.4.3"); | ||
| private static final DockerImageName KAFKA_TEST_IMAGE = DockerImageName.parse("confluentinc/cp-kafka:6.2.1"); | ||
| private static final DockerImageName ZOOKEEPER_TEST_IMAGE = DockerImageName.parse("confluentinc/cp-zookeeper:4.0.0"); | ||
|
|
||
| // junitRule { | ||
| @ClassRule | ||
| public static KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:5.4.3")); | ||
| // } | ||
|
|
||
| @Test | ||
| public void testUsage() throws Exception { | ||
| try (KafkaContainer kafka = new KafkaContainer(KAFKA_TEST_IMAGE)) { | ||
|
|
@@ -50,7 +45,7 @@ public void testUsage() throws Exception { | |
| public void testUsageWithSpecificImage() throws Exception { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think no real need to keep the general |
||
| try ( | ||
| // constructorWithVersion { | ||
| KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:5.4.3")) | ||
| KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:6.2.1")) | ||
| // } | ||
| ) { | ||
| kafka.start(); | ||
|
|
@@ -62,11 +57,10 @@ public void testUsageWithSpecificImage() throws Exception { | |
| } | ||
| } | ||
|
|
||
|
|
||
| @Test | ||
| public void testUsageWithVersion() throws Exception { | ||
| try ( | ||
| KafkaContainer kafka = new KafkaContainer("5.5.1") | ||
| KafkaContainer kafka = new KafkaContainer("6.2.1") | ||
| ) { | ||
| kafka.start(); | ||
| testKafkaFunctionality(kafka.getBootstrapServers()); | ||
|
|
@@ -105,9 +99,9 @@ public void testExternalZookeeperWithExternalNetwork() throws Exception { | |
| } | ||
|
|
||
| @Test | ||
| public void testConfluentPlatformVersion6() throws Exception { | ||
| public void testConfluentPlatformVersion5() throws Exception { | ||
| try ( | ||
| KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:6.0.0")) | ||
| KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:5.4.3")) | ||
| ) { | ||
| kafka.start(); | ||
| testKafkaFunctionality(kafka.getBootstrapServers()); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.