use of com.couchbase.client.core.msg.kv.UpsertResponse in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnAppend.
@Test
void tokenOnAppend() throws Exception {
String id = UUID.randomUUID().toString();
byte[] content = "hello".getBytes(UTF_8);
UpsertRequest upsertRequest = new UpsertRequest(id, content, 0, false, 0, kvTimeout, core.context(), collectionIdentifier, env.retryStrategy(), Optional.empty(), null);
core.send(upsertRequest);
UpsertResponse upsertResponse = upsertRequest.response().get();
assertTrue(upsertResponse.status().success());
assertMutationToken(upsertResponse.mutationToken());
AppendRequest appendRequest = new AppendRequest(kvTimeout, core.context(), collectionIdentifier, env.retryStrategy(), id, ", world".getBytes(UTF_8), upsertResponse.cas(), Optional.empty(), null);
core.send(appendRequest);
AppendResponse appendResponse = appendRequest.response().get();
assertTrue(appendResponse.status().success());
assertMutationToken(appendResponse.mutationToken());
}
use of com.couchbase.client.core.msg.kv.UpsertResponse in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnUpsert.
@Test
void tokenOnUpsert() throws Exception {
String id = UUID.randomUUID().toString();
byte[] content = "hello, world".getBytes(UTF_8);
UpsertRequest upsertRequest = new UpsertRequest(id, content, 0, false, 0, kvTimeout, core.context(), collectionIdentifier, env.retryStrategy(), Optional.empty(), null);
core.send(upsertRequest);
UpsertResponse upsertResponse = upsertRequest.response().get();
assertTrue(upsertResponse.status().success());
assertMutationToken(upsertResponse.mutationToken());
}
Aggregations