use of com.couchbase.client.core.msg.kv.IncrementResponse in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnIncrement.
@Test
void tokenOnIncrement() throws Exception {
String id = UUID.randomUUID().toString();
byte[] content = "1".getBytes(UTF_8);
InsertRequest insertRequest = new InsertRequest(id, content, 0, 0, kvTimeout, core.context(), collectionIdentifier, env.retryStrategy(), Optional.empty(), null);
core.send(insertRequest);
InsertResponse insertResponse = insertRequest.response().get();
assertTrue(insertResponse.status().success());
assertMutationToken(insertResponse.mutationToken());
IncrementRequest incrementRequest = new IncrementRequest(kvTimeout, core.context(), collectionIdentifier, env.retryStrategy(), id, 1, Optional.empty(), 0, Optional.empty(), null);
core.send(incrementRequest);
IncrementResponse incrementResponse = incrementRequest.response().get();
assertTrue(incrementResponse.status().success());
assertMutationToken(incrementResponse.mutationToken());
}
Aggregations