Skip to content

Commit

Permalink
Add method for getting Weaviate's gRPC port (#8431)
Browse files Browse the repository at this point in the history
  • Loading branch information
antas-marcin committed Mar 9, 2024
1 parent d3b0df2 commit 5bb9607
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/weaviate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ dependencies {
api project(':testcontainers')

testImplementation 'org.assertj:assertj-core:3.25.1'
testImplementation 'io.weaviate:client:4.5.1'
testImplementation 'io.weaviate:client:4.6.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ public WeaviateContainer(DockerImageName dockerImageName) {
public String getHttpHostAddress() {
return getHost() + ":" + getMappedPort(8080);
}

public String getGrpcHostAddress() {
return getHost() + ":" + getMappedPort(50051);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ public class WeaviateContainerTest {
@Test
public void test() {
try ( // container {
WeaviateContainer weaviate = new WeaviateContainer("semitechnologies/weaviate:1.22.4")
WeaviateContainer weaviate = new WeaviateContainer("semitechnologies/weaviate:1.24.1")
// }
) {
weaviate.start();
WeaviateClient client = new WeaviateClient(new Config("http", weaviate.getHttpHostAddress()));
Config config = new Config("http", weaviate.getHttpHostAddress());
config.setGRPCHost(weaviate.getGrpcHostAddress());
WeaviateClient client = new WeaviateClient(config);
Result<Meta> meta = client.misc().metaGetter().run();
assertThat(meta.getResult().getVersion()).isEqualTo("1.22.4");
assertThat(meta.getResult().getVersion()).isEqualTo("1.24.1");
}
}
}

0 comments on commit 5bb9607

Please sign in to comment.