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 @@ -17,6 +17,10 @@
*/
public class WeaviateContainer extends GenericContainer<WeaviateContainer> {

private static final int HTTP_PORT = 8080;

private static final int GRPC_PORT = 50051;

private static final DockerImageName DEFAULT_WEAVIATE_IMAGE = DockerImageName.parse(
"cr.weaviate.io/semitechnologies/weaviate"
);
Expand All @@ -30,17 +34,25 @@ public WeaviateContainer(String dockerImageName) {
public WeaviateContainer(DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_WEAVIATE_IMAGE, DOCKER_HUB_WEAVIATE_IMAGE);
withExposedPorts(8080, 50051);
withExposedPorts(HTTP_PORT, GRPC_PORT);
withEnv("AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED", "true");
withEnv("PERSISTENCE_DATA_PATH", "/var/lib/weaviate");
waitingFor(Wait.forHttp("/v1/.well-known/ready").forPort(8080).forStatusCode(200));
waitingFor(Wait.forHttp("/v1/.well-known/ready").forPort(HTTP_PORT).forStatusCode(200));
}

public String getHttpHostAddress() {
return getHost() + ":" + getMappedPort(8080);
return getHost() + ":" + getHttpPort();
}

public Integer getHttpPort() {
return getMappedPort(HTTP_PORT);
}

public String getGrpcHostAddress() {
return getHost() + ":" + getMappedPort(50051);
return getHost() + ":" + getGrpcPort();
}

public Integer getGrpcPort() {
return getMappedPort(GRPC_PORT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ void testWeaviate() throws Exception {
return conn
.scheme("http")
.httpHost(weaviate.getHost())
.httpPort(weaviate.getMappedPort(8080))
.httpPort(weaviate.getHttpPort())
.grpcHost(weaviate.getHost())
.grpcPort(weaviate.getMappedPort(50051));
.grpcPort(weaviate.getGrpcPort());
})
) {
InstanceMetadata meta = client.meta();
Expand Down Expand Up @@ -56,9 +56,9 @@ void testWeaviateWithModules() throws Exception {
return conn
.scheme("http")
.httpHost(weaviate.getHost())
.httpPort(weaviate.getMappedPort(8080))
.httpPort(weaviate.getHttpPort())
.grpcHost(weaviate.getHost())
.grpcPort(weaviate.getMappedPort(50051));
.grpcPort(weaviate.getGrpcPort());
})
) {
InstanceMetadata meta = client.meta();
Expand Down
Loading