use of com.couchbase.client.core.msg.kv.SubdocGetResponse in project couchbase-jvm-clients by couchbase.
the class SubDocumentGetIntegrationTest method checkExpectedSuccess.
/**
* Perform subdoc operations and check the overall result was success
*/
private SubdocGetResponse checkExpectedSuccess(String input, List<SubdocGetRequest.Command> commands) {
String id = UUID.randomUUID().toString();
insertContent(id, input);
SubdocGetRequest request = new SubdocGetRequest(kvTimeout, core.context(), CollectionIdentifier.fromDefault(config().bucketname()), env.retryStrategy(), id, (byte) 0, commands, null);
core.send(request);
SubdocGetResponse response = null;
try {
response = request.response().get();
} catch (InterruptedException | ExecutionException e) {
fail("Failed with " + e);
}
assertTrue(response.status().success());
assertFalse(response.error().isPresent());
return response;
}
use of com.couchbase.client.core.msg.kv.SubdocGetResponse in project couchbase-jvm-clients by couchbase.
the class SubDocumentGetIntegrationTest method existsDoesNotExistMulti.
@Test
void existsDoesNotExistMulti() {
List<SubdocGetRequest.Command> commands = Arrays.asList(new SubdocGetRequest.Command(SubdocCommandType.EXISTS, "cat", false, 0), new SubdocGetRequest.Command(SubdocCommandType.GET, "foo", false, 1));
SubdocGetResponse response = checkExpectedSuccess("{\"foo\":\"bar\"}", commands);
assertFalse(response.values()[0].status().success());
assertEquals(SubdocCommandType.EXISTS, response.values()[0].type());
}
Aggregations