Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
9efcd6d
refactor: use Optional<ConsistencyLevel>
bevzzz Feb 9, 2026
df181cf
wip(batch): add batch primitives (TaskHandle, Message, BatchContext
bevzzz Feb 9, 2026
2db0147
feat(batch): start a new batch from CollectionHandle
bevzzz Feb 10, 2026
5af3cb5
feat(batch): implement state transitions and event handling
bevzzz Feb 11, 2026
4dad5e0
chore(batch): remove old comment
bevzzz Feb 11, 2026
7e510dd
feat(batch): implement graceful shutdown and abort
bevzzz Feb 13, 2026
7e22f39
wip(batch): implement shutdown policies
bevzzz Feb 16, 2026
abb2d78
feat(batch): implement reconnect and shutdown policies
bevzzz Feb 17, 2026
3bd2424
chore(batch): fix type Messeger -> Messenger
bevzzz Feb 17, 2026
825bd65
fix(batch): perform OOM reconnect sequence via BaseState, not BatchCo…
bevzzz Feb 18, 2026
d60ed54
feat(batch): reconnect to GCP every 160 seconds
bevzzz Feb 18, 2026
c0c5898
fix(it): automatically pick up the latest container version
bevzzz Feb 16, 2026
55ff367
ci(test): add v1.36.0-rc.0 to the testing matrix
bevzzz Feb 16, 2026
64d4998
chore(pom.xml): update dependencies
bevzzz Feb 18, 2026
f29a274
test(batch): add the '10_000 objects' integration test
bevzzz Feb 18, 2026
c5ea8bd
fix(batch): remove redundat parameter from Event.Started
bevzzz Feb 18, 2026
1a4645d
fix(batch): use API compatible w/ JDK 17
bevzzz Feb 18, 2026
270f726
fix(batch): add OPENED state for when the stream hasn't been started
bevzzz Feb 18, 2026
9f28126
fix(batch): replace of -> ofNullable
bevzzz Feb 18, 2026
101936b
fix(batch): create empty EnumSet via noneOf
bevzzz Feb 18, 2026
7c1e2bc
fix(batch): start the context before returning it
bevzzz Feb 18, 2026
d1d497d
fix(batch): handle happy path
bevzzz Feb 19, 2026
9dca4d5
refactor(batch): keep safety margin for max gRPC message size
bevzzz Feb 24, 2026
ceeecca
fix(batch): update batch backlog correctly
bevzzz Feb 24, 2026
b729091
fix(batch): do not check invariants on entering setMaxSize()
bevzzz Feb 24, 2026
60c41ba
test(batch): test TranslatingStreamFactory
bevzzz Feb 24, 2026
c6d117f
feat(batch): updata batch.proto and adjust code
bevzzz Feb 24, 2026
1571d94
chore(proto): delete old gRPC service stub
bevzzz Feb 24, 2026
d06831a
fix: correct usage of Optional tenant
bevzzz Feb 25, 2026
16cb74a
ci(tests): run against Weaviate 1.36.0
bevzzz Feb 25, 2026
9c91703
Merge branch 'main' into feat/ssb
bevzzz Feb 25, 2026
45df7f2
chore(javadoc): do not use @apiNote in JDK 17
bevzzz Feb 25, 2026
7e6d6c6
feat: provide shorthand for an empty WeaviateObject
bevzzz Feb 25, 2026
7e2ca54
test(batch): add unit tests for TaskHandle
bevzzz Feb 25, 2026
453f62a
feat(batch): make default batch size and queue size configurable
bevzzz Feb 25, 2026
4aef132
test(batch): add tests for BatchContext
bevzzz Feb 25, 2026
40ca5de
fix(batch): avoid NPE in TaskHandle.POISON#toString
bevzzz Feb 26, 2026
2ff8314
fix(batch): fine-tuning reconnect flow after OOM and stream hangup
bevzzz Feb 26, 2026
e339dc4
chore(javadoc): remove <h3> tag
bevzzz Feb 26, 2026
0d8c268
test(batch): provide executor for running after-close events
bevzzz Feb 26, 2026
40b0ade
test(batch): drain after hangup
bevzzz Feb 26, 2026
b75d6a6
test(batch): await Results event to avoid flaky tests
bevzzz Feb 26, 2026
4ede901
test(batch): test ClientError flow triggered by exhausted reconect re…
bevzzz Feb 26, 2026
8921bab
ci(test): use latest Weaviate version
bevzzz Feb 26, 2026
f9a8d2f
chore: remove dummy method
bevzzz Feb 27, 2026
0477638
test(batch): cleanup BatchContextTest
bevzzz Feb 27, 2026
413bbb9
feat(batch): do not interrupt the parent thread if the context is bei…
bevzzz Feb 27, 2026
455decc
Merge branch 'main' into feat/ssb
bevzzz Feb 27, 2026
2aa7b20
test(it): stop cluster after ClusterITest
bevzzz Feb 27, 2026
f8f3135
test(batch): add 100ms wait to reduce flakiness in BatchContextTest
bevzzz Feb 27, 2026
5d7160a
test(batch): rename test case
bevzzz Feb 27, 2026
e28d1f9
docs(batch): document BatchContext
bevzzz Feb 27, 2026
a863655
test(oidc): add grace period for access token refresh
bevzzz Feb 27, 2026
d743089
chore(batch): fix javadoc
bevzzz Feb 27, 2026
1303422
test(batch): alias long variables
bevzzz Feb 27, 2026
c540cac
refactor(batch): structure Send and Recv as CompletableFutures
bevzzz Feb 27, 2026
cbdc64e
feat(batch): make sure to read all Results before closing the context
bevzzz Feb 27, 2026
72f3d33
chore(batch): update comment
bevzzz Feb 27, 2026
9903d95
test(batch): simplify integration test setup
bevzzz Feb 27, 2026
9a85950
test(batch): use explicit type
bevzzz Feb 27, 2026
966dabc
fix(batch): use Future for 'send' task, as it is actually cancelable
bevzzz Feb 28, 2026
475811b
debug(batch): add more detailed message to test assertion
bevzzz Feb 28, 2026
c3d1751
test(it): do not stop static containers
bevzzz Feb 28, 2026
b0fd5bb
fix(batch): guard against null reference
bevzzz Feb 28, 2026
a500693
chore: remove stale imports
bevzzz Mar 2, 2026
1a063ba
refactor: handle all events in BaseState
bevzzz Mar 2, 2026
84b2190
debug: disable tests which may potentially block
bevzzz Mar 2, 2026
07b1ce1
debug: ignore more tests
bevzzz Mar 2, 2026
3813d12
fix: replace %s -> %q formatting directive
bevzzz Mar 2, 2026
02493c7
debug: disable remaining integration tests
bevzzz Mar 2, 2026
89d2a33
debug: disable BatchContextTest
bevzzz Mar 2, 2026
3da6bdf
fix(batch): allow Oom to ignore incoming ServerShuttingDown message
bevzzz Mar 2, 2026
80c40cc
debug: re-introduce some of the integration tests
bevzzz Mar 2, 2026
1550648
debug: enable all integration tests
bevzzz Mar 2, 2026
be04879
debug: disable Oidc and Orm tests
bevzzz Mar 2, 2026
e5a1108
debug: enable BatchContextTest
bevzzz Mar 2, 2026
a208d7e
debug: re-activate Oidc/Orm tests
bevzzz Mar 2, 2026
5c24a38
fix(batch): improve reconnect and shutdown mechanisms
bevzzz Mar 2, 2026
8fe112b
debug: ignore Oidc test again
bevzzz Mar 2, 2026
7745f8f
test(oidc): ignore flaky test and enable test suite
bevzzz Mar 2, 2026
64213cc
test(batch): enable BatchContextTest
bevzzz Mar 2, 2026
67abb08
debug: disable oidc support test
bevzzz Mar 2, 2026
9239027
fix(batch): shutdown reconnect executor
bevzzz Mar 2, 2026
a57dd15
ci: only run BatchContextTest
bevzzz Mar 2, 2026
c23fd65
debug: only run OidcSupport test
bevzzz Mar 2, 2026
3f482e0
debug: skip Oidc test
bevzzz Mar 2, 2026
9043ad8
ci: run tests sequentially and run BatchContextTest first
bevzzz Mar 3, 2026
eecd7d4
fix(batch): avoid Assertions.catch*
bevzzz Mar 3, 2026
29c64d2
ci: run unit tests separately
bevzzz Mar 3, 2026
def925a
test(batch): increase timeout
bevzzz Mar 3, 2026
c33797b
test(batch): create individual executors for every test
bevzzz Mar 3, 2026
aee96c3
test(batch): add assertions
bevzzz Mar 3, 2026
e2c1116
test(oidc): add eventually to reduce flakiness
bevzzz Mar 3, 2026
c4e86ad
test(batch): increase timeout
bevzzz Mar 3, 2026
a08561f
chore: cleanup
bevzzz Mar 3, 2026
b535c9d
test(batch): re-arrange assertions
bevzzz Mar 3, 2026
a8b8ede
debug: delete assertion
bevzzz Mar 3, 2026
7bf805d
test(batch): reset interrupted flag before shutting down executors
bevzzz Mar 3, 2026
1e9fea4
fix(batch): implement review suggestions
bevzzz Mar 4, 2026
802d1fc
fix(batch): send batch and transition to IN_FLIGHT atomically
bevzzz Mar 5, 2026
f92b615
chore(batch): replace System.out.println with SLF4J logging
bevzzz Mar 5, 2026
3e5e3eb
chore(batch): add debug logs to tests
bevzzz Mar 5, 2026
e4a5819
chore(batch): change default logging format for tests
bevzzz Mar 5, 2026
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
45 changes: 29 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,32 @@ env:
DOCKER_IMAGES_TAR: docker-images.tar

jobs:
maven-cache:
name: Cache Maven dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "maven"
- run: mvn dependency:go-offline

unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "maven"
- run: mvn test -Dtest='!*ITest'

docker-cache:
needs: unit
name: Cache shared Docker images
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -59,22 +84,10 @@ jobs:
path: ${{ env.DOCKER_IMAGES_TAR }}
key: ${{ env.DOCKER_CACHE_KEY }}

maven-cache:
name: Cache Maven dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
cache: "maven"
- run: mvn dependency:go-offline

test:
name: Test
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs: [docker-cache, maven-cache]
needs: [maven-cache, unit, docker-cache]
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -118,4 +131,4 @@ jobs:
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
OPENAI_APIKEY: ${{ secrets.OPENAI_APIKEY }}
WEAVIATE_VERSION: ${{ matrix.WEAVIATE_VERSION }}
run: mvn verify -Dgpg.skip
run: mvn verify -Dtest='*ITest' -Dgpg.skip
17 changes: 7 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,8 @@
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
Expand Down Expand Up @@ -237,13 +236,11 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<parallel>classes</parallel>
<forkCount>4</forkCount>
<reuseForks>true</reuseForks>
<threadCount>1</threadCount>
<perCoreThreadCount>true</perCoreThreadCount>
<runOrder>balanced</runOrder>
<systemPropertyVariables>
<java.util.logging.config.file>
${project.basedir}/src/test/resources/logging.properties
</java.util.logging.config.file>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -546,5 +543,5 @@
<artifactId>central-publishing-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</build>
</project>
5 changes: 4 additions & 1 deletion src/it/java/io/weaviate/containers/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Container {
public static final MinIo MINIO = MinIo.createDefault();

public static ContainerGroup compose(Weaviate weaviate, GenericContainer<?>... containers) {
assert weaviate != WEAVIATE : "cannot compose with static WEAVIATE contaier";
return new ContainerGroup(weaviate, containers);
}

Expand Down Expand Up @@ -50,7 +51,9 @@ public void start() {
@Override
public void stop() {
weaviate.stop();
containers.forEach(GenericContainer::stop);
containers.stream()
.dropWhile(c -> c == MODEL2VEC || c == IMG2VEC_NEURAL || c == MINIO)
.forEach(GenericContainer::stop);
}

private void setSharedNetwork() {
Expand Down
5 changes: 5 additions & 0 deletions src/it/java/io/weaviate/containers/Weaviate.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public class Weaviate extends WeaviateContainer {
public static final String DOCKER_IMAGE = "semitechnologies/weaviate";
public static final String LATEST_VERSION = Version.latest().semver.toString();
public static final String VERSION;
private static final boolean DEBUG;

static {
VERSION = System.getenv().getOrDefault("WEAVIATE_VERSION", LATEST_VERSION);
DEBUG = System.getenv("DEBUG") != null;
}
public static String OIDC_ISSUER = "https://auth.wcs.api.weaviate.io/auth/realms/SeMI";

Expand Down Expand Up @@ -93,6 +95,9 @@ public String getContainerName() {
public WeaviateClient getClient() {
if (!isRunning()) {
start();
if (DEBUG) {
followOutput(frame -> System.out.println(frame.getUtf8String()));
}
}
if (clientInstance != null) {
return clientInstance;
Expand Down
13 changes: 10 additions & 3 deletions src/it/java/io/weaviate/integration/BackupITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeoutException;
import java.util.stream.IntStream;

import org.assertj.core.api.Assertions;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.junit.AfterClass;
import org.junit.Test;

import com.sun.nio.sctp.IllegalUnbindException;

import io.weaviate.ConcurrentTest;
import io.weaviate.client6.v1.api.WeaviateClient;
import io.weaviate.client6.v1.api.backup.Backup;
Expand All @@ -25,10 +26,16 @@
import io.weaviate.containers.Weaviate;

public class BackupITest extends ConcurrentTest {
private static final ExecutorService EXEC = Executors.newSingleThreadExecutor();
private static final WeaviateClient client = Weaviate.custom()
.withFilesystemBackup("/tmp/backups").build()
.getClient();

@AfterClass
public static void tearDown() {
EXEC.shutdownNow();
}

@Test
public void test_lifecycle() throws IOException, TimeoutException {
Weaviate.Version.V132.orSkip(); // List backups not implemented in earlier versions
Expand Down Expand Up @@ -258,6 +265,6 @@ private CompletableFuture<Void> spamData(String collectionName) {
throw new CompletionException(e);
}
return null;
});
}, EXEC);
}
}
41 changes: 41 additions & 0 deletions src/it/java/io/weaviate/integration/BatchITest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package io.weaviate.integration;

import java.io.IOException;

import org.assertj.core.api.Assertions;
import org.junit.BeforeClass;
import org.junit.Test;

import io.weaviate.ConcurrentTest;
import io.weaviate.client6.v1.api.WeaviateClient;
import io.weaviate.client6.v1.api.collections.WeaviateObject;
import io.weaviate.client6.v1.api.collections.batch.BatchContext;
import io.weaviate.containers.Container;
import io.weaviate.containers.Weaviate;

public class BatchITest extends ConcurrentTest {
private static final WeaviateClient client = Container.WEAVIATE.getClient();

@BeforeClass
public static void __() {
Weaviate.Version.V136.orSkip();
}

@Test
public void test10_000Objects() throws IOException {
var nsThings = ns("Things");

var things = client.collections.create(nsThings);

// Act
try (BatchContext<?> batch = things.batch.start()) {
for (int i = 0; i < 10_000; i++) {
batch.add(WeaviateObject.of());
}
} catch (InterruptedException e) {
}

// Assert
Assertions.assertThat(things.size()).isEqualTo(10_000);
}
}
9 changes: 8 additions & 1 deletion src/it/java/io/weaviate/integration/ClusterITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.IOException;

import org.assertj.core.api.Assertions;
import org.junit.AfterClass;
import org.junit.Test;

import io.weaviate.ConcurrentTest;
Expand All @@ -17,7 +18,13 @@
import io.weaviate.containers.Weaviate.Version;

public class ClusterITest extends ConcurrentTest {
private static final WeaviateClient client = Weaviate.cluster(3).getClient();
private static final Weaviate cluster = Weaviate.cluster(3);
private static final WeaviateClient client = cluster.getClient();

@AfterClass
public static void tearDown() {
cluster.stop();
}

@Test
public void test_shardingState() throws IOException {
Expand Down
4 changes: 2 additions & 2 deletions src/it/java/io/weaviate/integration/CollectionsITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,8 @@ public void test_dropPropertyIndex() throws IOException {
.returns(false, Property::indexFilterable)
.returns(false, Property::indexSearchable)
.returns(false, Property::indexRangeFilters));
}
}

@Test
public void test_asyncReplicationConfig() throws IOException {
Weaviate.Version.latest().orSkip();
Expand Down
2 changes: 1 addition & 1 deletion src/it/java/io/weaviate/integration/DataITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public void testDataTypes() throws IOException {
.asInstanceOf(InstanceOfAssertFactories.map(String.class, Object.class))
// Most of PhoneNumber fields are only present on read and are null on write.
.usingRecursiveComparison()
.withComparatorForType(ORMITest::comparePhoneNumbers, PhoneNumber.class)
.withComparatorForType(OrmITest::comparePhoneNumbers, PhoneNumber.class)
.isEqualTo(want);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import org.assertj.core.api.Assertions;
import org.junit.Assume;
import org.junit.Ignore;
import org.junit.Test;

import io.weaviate.ConcurrentTest;
Expand All @@ -28,7 +29,7 @@
* Additionally, {@code WCS_DUMMY_CI_PW} and {@code OKTA_CLIENT_SECRET}
* environment variables must be set.
*/
public class OIDCSupportITest extends ConcurrentTest {
public class OidcSupportITest extends ConcurrentTest {
private static final String WCS_DUMMY_CI_USERNAME = "oidc-test-user@weaviate.io";
private static final String WCS_DUMMY_CI_PW = System.getenv("WCS_DUMMY_CI_PW");

Expand Down Expand Up @@ -66,10 +67,7 @@ public void test_bearerToken() throws Exception {
var auth = SpyTokenProvider.spyOn(Authentication.bearerToken(t.accessToken(), t.refreshToken(), 0));
pingWeaviate(wcsContainer, auth);

var newT = auth.getToken();
Assertions.assertThat(newT.accessToken())
.as("expect access_token was refreshed")
.isNotEqualTo(t.accessToken());
eventually(() -> auth.getToken() != t, 100, 5, "expect access_token was refreshed");

// Check that the new token authenticates requests.
pingWeaviate(wcsContainer, auth);
Expand All @@ -81,7 +79,7 @@ public void test_resourceOwnerPassword() throws Exception {
Assume.assumeTrue("WCS_DUMMY_CI_PW is not set", WCS_DUMMY_CI_PW != null && !WCS_DUMMY_CI_PW.isBlank());
Assume.assumeTrue("no internet connection", hasInternetConnection());

// Check norwal resource owner password flow works.
// Check normal resource owner password flow works.
var password = Authentication.resourceOwnerPassword(WCS_DUMMY_CI_USERNAME, WCS_DUMMY_CI_PW, List.of());
var auth = SpyTokenProvider.spyOn(password);
pingWeaviate(wcsContainer, auth);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io.weaviate.client6.v1.api.collections.query.Filter;
import io.weaviate.containers.Container;

public class ORMITest extends ConcurrentTest {
public class OrmITest extends ConcurrentTest {
private static final WeaviateClient client = Container.WEAVIATE.getClient();

@Collection("ORMITestThings")
Expand Down Expand Up @@ -166,7 +166,7 @@ public void test_createCollection() throws Exception {
// so we'll just always return true here.
.withComparatorForFields((a, b) -> 0, "floatBoxedList")
.withComparatorForType((a, b) -> Double.compare(a.doubleValue(), b.doubleValue()), Number.class)
.withComparatorForType(ORMITest::comparePhoneNumbers, PhoneNumber.class)
.withComparatorForType(OrmITest::comparePhoneNumbers, PhoneNumber.class)
.build();

@Test
Expand Down
49 changes: 49 additions & 0 deletions src/it/java/io/weaviate/integration/SearchITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import io.weaviate.client6.v1.api.collections.generate.GenerativeObject;
import io.weaviate.client6.v1.api.collections.generate.TaskOutput;
import io.weaviate.client6.v1.api.collections.generative.DummyGenerative;
import io.weaviate.client6.v1.api.collections.query.FetchObjectById;
import io.weaviate.client6.v1.api.collections.query.Filter;
import io.weaviate.client6.v1.api.collections.query.GroupBy;
import io.weaviate.client6.v1.api.collections.query.Metadata;
Expand Down Expand Up @@ -790,4 +791,52 @@ public void test_rerankQueries() throws IOException {
// Assert: ranking not important really, just that the request was valid.
Assertions.assertThat(got.objects()).hasSize(2);
}

@Test
public void testVectorizerModel2VecPropeties() throws IOException {
var collectionName = ns("Books");
client.collections.create(collectionName,
col -> col
.properties(Property.text("title"), Property.text("author"))
.vectorConfig(
VectorConfig.text2vecModel2Vec("title_vec", v -> v.sourceProperties("title")),
VectorConfig.text2vecModel2Vec("author_vec", v -> v.sourceProperties("author"))));

var books = client.collections.use(collectionName);
Assertions.assertThat(books).isNotNull();

WeaviateObject<Map<String, Object>> dune = WeaviateObject.of(
o -> o.properties(Map.of(
"title", "Dune",
"author", "Frank Herbert")));
WeaviateObject<Map<String, Object>> abc = WeaviateObject.of(
o -> o.properties(Map.of(
"title", "ABC",
"author", "ABC")));

var resp = books.data.insertMany(dune, abc);
Assertions.assertThat(resp).isNotNull().satisfies(s -> {
Assertions.assertThat(s.errors()).isEmpty();
});

// Assert that for Dune we have generated 2 different vectors
var gotDune = books.query.fetchObjectById(dune.uuid(), FetchObjectById.Builder::includeVector);
Assertions.assertThat(gotDune).get()
.extracting(WeaviateObject::vectors)
.satisfies(v -> {
Assertions.assertThat(v.getSingle("title_vec")).isNotEmpty();
Assertions.assertThat(v.getSingle("author_vec")).isNotEmpty();
Assertions.assertThat(v.getSingle("title_vec")).isNotEqualTo(v.getSingle("author_vec"));
});

// Assert that for ABC we have generated same vectors
var gotAbc = books.query.fetchObjectById(abc.uuid(), FetchObjectById.Builder::includeVector);
Assertions.assertThat(gotAbc).get()
.extracting(WeaviateObject::vectors)
.satisfies(v -> {
Assertions.assertThat(v.getSingle("title_vec")).isNotEmpty();
Assertions.assertThat(v.getSingle("author_vec")).isNotEmpty();
Assertions.assertThat(v.getSingle("title_vec")).isEqualTo(v.getSingle("author_vec"));
});
}
}
Loading