Skip to content

Commit

Permalink
Merge pull request #25584 from eddumelendez/polish_tc
Browse files Browse the repository at this point in the history
Use getHost instead of getContainerIpAddress
  • Loading branch information
gastaldi authored May 15, 2022
2 parents c63f1fc + e259a51 commit 3f94ebd
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/kafka-schema-registry-avro.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi
registry.start();
Map<String, String> properties = new HashMap<>();
properties.put("mp.messaging.connector.smallrye-kafka.apicurio.registry.url",
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/apis/registry/v2");
"http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/apis/registry/v2");
properties.put("kafka.bootstrap.servers", kafka.getBootstrapServers());
return properties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public class KafkaAndSchemaRegistryTestResource implements QuarkusTestResourceLi
private static GenericContainer<?> registry;

public static String getConfluentSchemaRegistryUrl() {
return "http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api/ccompat";
return "http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api/ccompat";
}

public static String getApicurioSchemaRegistryUrl() {
return "http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api";
return "http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api";
}

@Override
Expand All @@ -27,9 +27,9 @@ public Map<String, String> start() {
registry.start();
Map<String, String> properties = new HashMap<>();
properties.put("schema.url.confluent",
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api/ccompat");
"http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api/ccompat");
properties.put("schema.url.apicurio",
"http://" + registry.getContainerIpAddress() + ":" + registry.getMappedPort(8080) + "/api");
"http://" + registry.getHost() + ":" + registry.getMappedPort(8080) + "/api");
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Map<String, String> start() {
.withNetworkAliases("kafka")
.withServerProperties(MountableFile.forClasspathResource("kafkaServer.properties"))
.withBootstrapServers(
c -> String.format("JWT://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)));
c -> String.format("JWT://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)));
this.kafka.start();
log.info(this.kafka.getLogs());
properties.put("kafka.bootstrap.servers", this.kafka.getBootstrapServers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Map<String, String> start() {
//Start kafka container
kafka = new StrimziKafkaContainer()
.withBootstrapServers(
c -> String.format("SASL_PLAINTEXT://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)))
c -> String.format("SASL_PLAINTEXT://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)))
.withPort(KAFKA_PORT)
.withServerProperties(MountableFile.forClasspathResource("kafkaServer.properties"))
.withCopyFileToContainer(MountableFile.forClasspathResource("krb5KafkaBroker.conf"), "/etc/krb5.conf")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class KafkaSASLTestResource implements QuarkusTestResourceLifecycleManage
private final StrimziKafkaContainer kafka = new StrimziKafkaContainer()
.withServerProperties(MountableFile.forClasspathResource("server.properties"))
.withBootstrapServers(
container -> String.format("SASL_PLAINTEXT://%s:%s", container.getContainerIpAddress(),
container -> String.format("SASL_PLAINTEXT://%s:%s", container.getHost(),
container.getMappedPort(KAFKA_PORT)));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class KafkaSSLTestResource implements QuarkusTestResourceLifecycleManager {

private final StrimziKafkaContainer kafka = new StrimziKafkaContainer()
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)))
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)))
.withServerProperties(MountableFile.forClasspathResource("server.properties"))
.withCopyFileToContainer(MountableFile.forClasspathResource("kafka-keystore.p12"),
"/opt/kafka/config/kafka-keystore.p12")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class KafkaSSLTestResource implements QuarkusTestResourceLifecycleManager

private static final StrimziKafkaContainer kafka = new StrimziKafkaContainer()
.withServerProperties(MountableFile.forClasspathResource("server.properties"))
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getContainerIpAddress(), c.getMappedPort(KAFKA_PORT)))
.withBootstrapServers(c -> String.format("SSL://%s:%s", c.getHost(), c.getMappedPort(KAFKA_PORT)))
.withCopyFileToContainer(MountableFile.forClasspathResource("ks-keystore.p12"),
"/opt/kafka/config/kafka-keystore.p12")
.withCopyFileToContainer(MountableFile.forClasspathResource("ks-truststore.p12"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public Map<String, String> start() {
server.start();
HashMap<String, String> properties = new HashMap<>();
properties.put("quarkus.mailer.port", Integer.toString(server.getMappedPort(1025)));
properties.put("quarkus.mailer.host", server.getContainerIpAddress());
properties.put("fake.mailer", server.getContainerIpAddress() + ":" + server.getMappedPort(1080));
properties.put("quarkus.mailer.host", server.getHost());
properties.put("fake.mailer", server.getHost() + ":" + server.getMappedPort(1080));
// properties.put("quarkus.mailer.port", Integer.toString(32787));
// properties.put("quarkus.mailer.host", "localhost");
// properties.put("fake.mailer", "localhost" + ":" + 32786);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Map<String, String> start() {
Map<String, String> properties = new HashMap<>();

coordinatorEndpoint = String.format("http://%s:%d/%s",
registry.getContainerIpAddress(),
registry.getHost(),
registry.getFirstMappedPort(),
LRAConstants.COORDINATOR_PATH_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Map<String, String> start() {
HOTROD_PORT, USER, PASSWORD);
INFINISPAN.start();

final String hosts = INFINISPAN.getContainerIpAddress() + ":" + INFINISPAN.getMappedPort(HOTROD_PORT);
final String hosts = INFINISPAN.getHost() + ":" + INFINISPAN.getMappedPort(HOTROD_PORT);
return Collections.singletonMap("quarkus.infinispan-client.server-list", hosts);
}

Expand Down

0 comments on commit 3f94ebd

Please sign in to comment.