use of com.couchbase.client.core.msg.kv.DecrementResponse in project couchbase-jvm-clients by couchbase.
the class MutationTokenIntegrationTest method tokenOnDecrement.
@Test
void tokenOnDecrement() throws Exception {
String id = UUID.randomUUID().toString();
byte[] content = "10".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());
DecrementRequest decrementRequest = new DecrementRequest(kvTimeout, core.context(), collectionIdentifier, env.retryStrategy(), id, 1, Optional.empty(), 0, Optional.empty(), null);
core.send(decrementRequest);
DecrementResponse decrementResponse = decrementRequest.response().get();
assertTrue(decrementResponse.status().success());
assertMutationToken(decrementResponse.mutationToken());
}
Aggregations