Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class DisqueBackedMailSenderTest {
@Before
public void setup() {
context("");
disqueClient = new DisqueClient(DisqueURI.create(container.getContainerIpAddress(), container.getMappedPort(7711)));
disqueClient = new DisqueClient(DisqueURI.create(container.getHost(), container.getMappedPort(7711)));
mockMailApiClient = mock(MailApiClient.class);

service = new DisqueBackedMailSenderService(disqueClient, mockMailApiClient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SingleDisqueInstanceTest {
@Before
public void setup() {
context("");
DisqueClient client = new DisqueClient(DisqueURI.create(container.getContainerIpAddress(), container.getMappedPort(7711)));
DisqueClient client = new DisqueClient(DisqueURI.create(container.getHost(), container.getMappedPort(7711)));
connection = client.connect().sync();
retryAfter1Second = AddJobArgs.builder().retry(1, TimeUnit.SECONDS).build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public RedmineContainer withLinkToContainer(LinkableContainer otherContainer, St

public String getRedmineUrl() {
return String.format("http://%s:%d",
this.getContainerIpAddress(),
this.getHost(),
this.getMappedPort(REDMINE_PORT));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void containerStartsAndPublicPortIsAvailable() {

private void assertThatPortIsAvailable(MongoDbContainer container) {
try {
new Socket(container.getContainerIpAddress(), container.getPort());
new Socket(container.getHost(), container.getPort());
} catch (IOException e) {
throw new AssertionError("The expected port " + container.getPort() + " is not available!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void stopContainer() {

@BeforeMethod
public void setUp() {
Jedis jedis = new Jedis(redis.getContainerIpAddress(), redis.getMappedPort(6379));
Jedis jedis = new Jedis(redis.getHost(), redis.getMappedPort(6379));

cache = new RedisBackedCache(jedis, "test");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class RedisBackedCacheTest {

@Before
public void setUp() throws Exception {
Jedis jedis = new Jedis(redis.getContainerIpAddress(), redis.getMappedPort(6379));
Jedis jedis = new Jedis(redis.getHost(), redis.getMappedPort(6379));

cache = new RedisBackedCache(jedis, "test");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BarConcreteTestClass extends AbstractIntegrationTest {

@Before
public void setUp() {
Jedis jedis = new Jedis(redis.getContainerIpAddress(), redis.getMappedPort(6379));
Jedis jedis = new Jedis(redis.getHost(), redis.getMappedPort(6379));

cache = new RedisBackedCache(jedis, "bar");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class FooConcreteTestClass extends AbstractIntegrationTest {

@Before
public void setUp() throws Exception {
Jedis jedis = new Jedis(redis.getContainerIpAddress(), redis.getMappedPort(6379));
Jedis jedis = new Jedis(redis.getHost(), redis.getMappedPort(6379));

cache = new RedisBackedCache(jedis, "foo");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class SolrQueryTest {
@BeforeClass
public static void setUp() throws IOException, SolrServerException {
solrContainer.start();
solrClient = new Http2SolrClient.Builder("http://" + solrContainer.getContainerIpAddress() + ":" + solrContainer.getSolrPort() + "/solr").build();
solrClient = new Http2SolrClient.Builder("http://" + solrContainer.getHost() + ":" + solrContainer.getSolrPort() + "/solr").build();

// Add Sample Data
solrClient.add(COLLECTION_NAME, Collections.singletonList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public DatastoreEmulatorContainer(final DockerImageName dockerImageName) {
* com.google.cloud.ServiceOptions.Builder#setHost(java.lang.String) method.
*/
public String getEmulatorEndpoint() {
return getContainerIpAddress() + ":" + getMappedPort(8081);
return getHost() + ":" + getMappedPort(8081);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public FirestoreEmulatorContainer(final DockerImageName dockerImageName) {
* com.google.cloud.ServiceOptions.Builder#setHost(java.lang.String) method.
*/
public String getEmulatorEndpoint() {
return getContainerIpAddress() + ":" + getMappedPort(8080);
return getHost() + ":" + getMappedPort(8080);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public PubSubEmulatorContainer(final DockerImageName dockerImageName) {
* io.grpc.ManagedChannelBuilder#forTarget(java.lang.String) method.
*/
public String getEmulatorEndpoint() {
return getContainerIpAddress() + ":" + getMappedPort(PORT);
return getHost() + ":" + getMappedPort(PORT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public SpannerEmulatorContainer(final DockerImageName dockerImageName) {
* com.google.cloud.spanner.SpannerOptions.Builder#setEmulatorHost(java.lang.String) method.
*/
public String getEmulatorGrpcEndpoint() {
return getContainerIpAddress() + ":" + getMappedPort(GRPC_PORT);
return getHost() + ":" + getMappedPort(GRPC_PORT);
}

/**
* @return a <code>host:port</code> pair corresponding to the address on which the emulator's
* HTTP REST endpoint is reachable from the test host machine.
*/
public String getEmulatorHttpEndpoint() {
return getContainerIpAddress() + ":" + getMappedPort(HTTP_PORT);
return getHost() + ":" + getMappedPort(HTTP_PORT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public String getReplicaSetUrl(final String databaseName) {
}
return String.format(
"mongodb://%s:%d/%s",
getContainerIpAddress(),
getHost(),
getMappedPort(MONGODB_INTERNAL_PORT),
databaseName
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public String getDriverClassName() {
@Override
public String getJdbcUrl() {
String additionalUrlParams = constructUrlParameters("?", "&");
return "jdbc:postgresql://" + getContainerIpAddress() + ":" + getMappedPort(POSTGRESQL_PORT)
return "jdbc:postgresql://" + getHost() + ":" + getMappedPort(POSTGRESQL_PORT)
+ "/" + databaseName + additionalUrlParams;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ protected void containerIsStarted(InspectContainerResponse containerInfo) {

if (StringUtils.isNotEmpty(configuration.getConfigurationName())) {
SolrClientUtils.uploadConfiguration(
getContainerIpAddress(),
getHost(),
getSolrPort(),
configuration.getConfigurationName(),
configuration.getSolrConfiguration(),
configuration.getSolrSchema());
}

SolrClientUtils.createCollection(
getContainerIpAddress(),
getHost(),
getSolrPort(),
configuration.getCollectionName(),
configuration.getConfigurationName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void solrCloudPingTest() throws IOException, SolrServerException {
container.start();

// Do whatever you want with the client ...
SolrClient client = new Http2SolrClient.Builder("http://" + container.getContainerIpAddress() + ":" + container.getSolrPort() + "/solr").build();
SolrClient client = new Http2SolrClient.Builder("http://" + container.getHost() + ":" + container.getSolrPort() + "/solr").build();
SolrPingResponse response = client.ping("dummy");

// Stop the container.
Expand All @@ -70,7 +70,7 @@ public void solrCloudPingTest() throws IOException, SolrServerException {

private SolrClient getClient(SolrContainer container) {
if (client == null) {
client = new Http2SolrClient.Builder("http://" + container.getContainerIpAddress() + ":" + container.getSolrPort() + "/solr").build();
client = new Http2SolrClient.Builder("http://" + container.getHost() + ":" + container.getSolrPort() + "/solr").build();
}
return client;
}
Expand Down