Skip to content

Commit 2fc40d1

Browse files
committed
influx-db-container fixed after code review
1 parent 4c9c164 commit 2fc40d1

File tree

7 files changed

+12
-59
lines changed

7 files changed

+12
-59
lines changed

modules/influxdb/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public class SomeTest {
2222

2323
Replace `VERSION` with the [latest version available on Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.testcontainers%22).
2424

25+
[![](https://api.bintray.com/packages/testcontainers/releases/testcontainers/images/download.svg)](https://bintray.com/testcontainers/releases/testcontainers/_latestVersion)
26+
27+
2528
### Maven
2629
```
2730
<dependency>

modules/influxdb/build.gradle

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
description = "Testcontainers :: InfluxDB"
22

3-
ext {
4-
influxdbJavaClientVersion = '2.9'
5-
6-
junitVersion = '4.12'
7-
}
8-
93
dependencies {
104
compile project(':testcontainers')
115

12-
compile "org.influxdb:influxdb-java:${influxdbJavaClientVersion}"
13-
14-
testCompile "junit:junit:$junitVersion"
6+
compileOnly 'org.influxdb:influxdb-java:2.10'
7+
testCompile 'org.influxdb:influxdb-java:2.10'
158
}

modules/influxdb/src/main/java/org/testcontainers/containers/InfluxDBContainer.java

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,20 @@
66
import org.testcontainers.containers.wait.strategy.Wait;
77
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
88

9-
import java.util.UUID;
10-
119
/**
1210
* @link https://store.docker.com/images/influxdb
1311
*/
1412
public class InfluxDBContainer<SELF extends InfluxDBContainer<SELF>> extends GenericContainer<SELF>
1513
implements LinkableContainer {
1614

17-
public static final String VERSION = "latest";
15+
public static final String VERSION = "1.4.3";
1816
public static final Integer INFLUXDB_PORT = 8086;
1917

2018
private static final String IMAGE_NAME = "influxdb";
2119

2220
private boolean authEnabled = true;
2321
private String admin = "admin";
24-
private String adminPassword = UUID.randomUUID().toString();
22+
private String adminPassword = "password";
2523

2624
private String database;
2725
private String username = "any";
@@ -58,16 +56,6 @@ protected Integer getLivenessCheckPort() {
5856
return getMappedPort(INFLUXDB_PORT);
5957
}
6058

61-
/**
62-
* Bind a fixed port on the docker host to a container port
63-
*
64-
* @param hostPort a port on the docker host, which must be available
65-
* @return a reference to this container instance
66-
*/
67-
public SELF withFixedExposedPort(int hostPort) {
68-
super.addFixedExposedPort(hostPort, INFLUXDB_PORT);
69-
return self();
70-
}
7159

7260
/**
7361
* Set env variable `INFLUXDB_HTTP_AUTH_ENABLED`.

modules/influxdb/src/test/java/org/testcontainers/containers/InfluxDBContainerTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import static org.hamcrest.CoreMatchers.is;
88
import static org.hamcrest.CoreMatchers.notNullValue;
9-
import static org.hamcrest.CoreMatchers.startsWith;
109
import static org.junit.Assert.assertThat;
1110

1211
public class InfluxDBContainerTest {
@@ -18,7 +17,7 @@ public class InfluxDBContainerTest {
1817
public void getUrl() {
1918
String actual = influxDBContainer.getUrl();
2019

21-
assertThat(actual, startsWith("http://localhost:"));
20+
assertThat(actual, notNullValue());
2221
}
2322

2423
@Test

modules/influxdb/src/test/resources/logback-test.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<logger name="com.github.dockerjava" level="WARN"/>
1717
<logger name="org.zeroturnaround.exec" level="WARN"/>
1818
<logger name="com.zaxxer.hikari" level="INFO"/>
19-
<logger name="org.rnorth.tcpunixsocketproxy" level="INFO" />
20-
<logger name="io.netty" level="WARN" />
21-
<logger name="org.mongodb" level="INFO" />
19+
<logger name="org.rnorth.tcpunixsocketproxy" level="INFO"/>
20+
<logger name="io.netty" level="WARN"/>
21+
<logger name="org.mongodb" level="INFO"/>
2222
<logger name="org.testcontainers.shaded" level="WARN"/>
2323
<logger name="com.zaxxer.hikari" level="INFO"/>
2424
</configuration>

modules/spock/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ dependencies {
99
compile 'org.spockframework:spock-core:1.0-groovy-2.4'
1010

1111
testCompile project(':mysql')
12-
testCompile project(':influxdb')
1312
testCompile project(':postgresql')
1413
testCompile 'com.zaxxer:HikariCP:2.6.1'
1514

1615
testRuntime 'org.postgresql:postgresql:42.0.0'
1716
testRuntime 'mysql:mysql-connector-java:6.0.6'
18-
}
17+
}

modules/spock/src/test/groovy/org/testcontainers/spock/InfluxDBContainerIT.groovy

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)