Skip to content

Commit

Permalink
influx-db-container fixed after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
banadiga committed May 14, 2018
1 parent 4c9c164 commit 2fc40d1
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 59 deletions.
3 changes: 3 additions & 0 deletions modules/influxdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public class SomeTest {

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

[![](https://api.bintray.com/packages/testcontainers/releases/testcontainers/images/download.svg)](https://bintray.com/testcontainers/releases/testcontainers/_latestVersion)


### Maven
```
<dependency>
Expand Down
11 changes: 2 additions & 9 deletions modules/influxdb/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
description = "Testcontainers :: InfluxDB"

ext {
influxdbJavaClientVersion = '2.9'

junitVersion = '4.12'
}

dependencies {
compile project(':testcontainers')

compile "org.influxdb:influxdb-java:${influxdbJavaClientVersion}"

testCompile "junit:junit:$junitVersion"
compileOnly 'org.influxdb:influxdb-java:2.10'
testCompile 'org.influxdb:influxdb-java:2.10'
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;

import java.util.UUID;

/**
* @link https://store.docker.com/images/influxdb
*/
public class InfluxDBContainer<SELF extends InfluxDBContainer<SELF>> extends GenericContainer<SELF>
implements LinkableContainer {

public static final String VERSION = "latest";
public static final String VERSION = "1.4.3";
public static final Integer INFLUXDB_PORT = 8086;

private static final String IMAGE_NAME = "influxdb";

private boolean authEnabled = true;
private String admin = "admin";
private String adminPassword = UUID.randomUUID().toString();
private String adminPassword = "password";

private String database;
private String username = "any";
Expand Down Expand Up @@ -58,16 +56,6 @@ protected Integer getLivenessCheckPort() {
return getMappedPort(INFLUXDB_PORT);
}

/**
* Bind a fixed port on the docker host to a container port
*
* @param hostPort a port on the docker host, which must be available
* @return a reference to this container instance
*/
public SELF withFixedExposedPort(int hostPort) {
super.addFixedExposedPort(hostPort, INFLUXDB_PORT);
return self();
}

/**
* Set env variable `INFLUXDB_HTTP_AUTH_ENABLED`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.junit.Assert.assertThat;

public class InfluxDBContainerTest {
Expand All @@ -18,7 +17,7 @@ public class InfluxDBContainerTest {
public void getUrl() {
String actual = influxDBContainer.getUrl();

assertThat(actual, startsWith("http://localhost:"));
assertThat(actual, notNullValue());
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions modules/influxdb/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<logger name="com.github.dockerjava" level="WARN"/>
<logger name="org.zeroturnaround.exec" level="WARN"/>
<logger name="com.zaxxer.hikari" level="INFO"/>
<logger name="org.rnorth.tcpunixsocketproxy" level="INFO" />
<logger name="io.netty" level="WARN" />
<logger name="org.mongodb" level="INFO" />
<logger name="org.rnorth.tcpunixsocketproxy" level="INFO"/>
<logger name="io.netty" level="WARN"/>
<logger name="org.mongodb" level="INFO"/>
<logger name="org.testcontainers.shaded" level="WARN"/>
<logger name="com.zaxxer.hikari" level="INFO"/>
</configuration>
3 changes: 1 addition & 2 deletions modules/spock/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ dependencies {
compile 'org.spockframework:spock-core:1.0-groovy-2.4'

testCompile project(':mysql')
testCompile project(':influxdb')
testCompile project(':postgresql')
testCompile 'com.zaxxer:HikariCP:2.6.1'

testRuntime 'org.postgresql:postgresql:42.0.0'
testRuntime 'mysql:mysql-connector-java:6.0.6'
}
}

This file was deleted.

0 comments on commit 2fc40d1

Please sign in to comment.