-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
742 additions
and
201 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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
37 changes: 37 additions & 0 deletions
37
...em-tests/src/test/java/org/eclipse/edc/samples/transfer/streaming/KafkaSaslContainer.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.eclipse.edc.samples.transfer.streaming; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.testcontainers.containers.KafkaContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
||
/** | ||
* Extension of the {@link KafkaContainer} that permits to set the SASL_PLAINTEXT security protocol | ||
*/ | ||
public class KafkaSaslContainer extends KafkaContainer { | ||
|
||
private static final String KAFKA_IMAGE_NAME = "confluentinc/cp-kafka:7.5.2"; | ||
private final File envFile; | ||
|
||
public KafkaSaslContainer(@NotNull File envFile) { | ||
super(DockerImageName.parse(KAFKA_IMAGE_NAME)); | ||
this.withKraft(); | ||
this.envFile = envFile; | ||
} | ||
|
||
@Override | ||
protected void configureKraft() { | ||
super.configureKraft(); | ||
try { | ||
Files.readAllLines(envFile.toPath()) | ||
.stream().map(it -> it.split("=", 2)) | ||
.forEach(it -> this.withEnv(it[0], it[1])); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.