use of com.couchbase.client.java.kv.MutationResult in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnInsert.
@Test
void tokenOnInsert() {
String id = UUID.randomUUID().toString();
MutationResult result = collection.insert(id, JsonObject.create());
assertMutationToken(result.mutationToken());
}
use of com.couchbase.client.java.kv.MutationResult in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnUpsert.
@Test
void tokenOnUpsert() {
String id = UUID.randomUUID().toString();
MutationResult result = collection.upsert(id, JsonObject.create());
assertMutationToken(result.mutationToken());
}
use of com.couchbase.client.java.kv.MutationResult in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnSubdocMutate.
@Test
void tokenOnSubdocMutate() {
String id = UUID.randomUUID().toString();
MutationResult result = collection.upsert(id, JsonObject.create());
assertMutationToken(result.mutationToken());
MutateInResult mutateResult = collection.mutateIn(id, Arrays.asList(MutateInSpec.insert("foo", true)));
assertMutationToken(mutateResult.mutationToken());
}
use of com.couchbase.client.java.kv.MutationResult in project couchbase-jvm-clients by couchbase.
the class ObserveIntegrationTest method removePersistToActive.
@Test
void removePersistToActive() {
String id = UUID.randomUUID().toString();
MutationResult result = collection.insert(id, "some value", insertOptions().durability(PersistTo.ACTIVE, ReplicateTo.NONE));
assertTrue(result.cas() != 0);
MutationResult removeResult = collection.remove(id, removeOptions().durability(PersistTo.ACTIVE, ReplicateTo.NONE));
assertTrue(removeResult.cas() != 0);
assertTrue(result.cas() != removeResult.cas());
assertTrue(result.mutationToken().isPresent());
}
use of com.couchbase.client.java.kv.MutationResult in project couchbase-jvm-clients by couchbase.
the class ObserveIntegrationTest method persistToActive.
@Test
void persistToActive() {
String id = UUID.randomUUID().toString();
MutationResult result = collection.insert(id, "some value", insertOptions().durability(PersistTo.ACTIVE, ReplicateTo.NONE));
assertTrue(result.cas() != 0);
assertTrue(result.mutationToken().isPresent());
}
Aggregations