Search in sources :

Example 1 with PathMismatchException

use of com.couchbase.client.core.error.subdoc.PathMismatchException in project couchbase-jvm-clients by couchbase.

the class SubDocumentGetIntegrationTest method pathMismatchMulti.

@Test
void pathMismatchMulti() {
    List<SubdocGetRequest.Command> commands = Arrays.asList(new SubdocGetRequest.Command(SubdocCommandType.GET, "foo", false, 0), new SubdocGetRequest.Command(SubdocCommandType.GET, "foo.bar[0].baz", false, 1));
    SubdocGetResponse response = checkExpectedSuccess("{\"foo\":\"bar\"}", commands);
    assertTrue(response.values()[0].status().success());
    assertEquals(SubDocumentOpResponseStatus.PATH_MISMATCH, response.values()[1].status());
    assertTrue(response.values()[1].error().get() instanceof PathMismatchException);
}
Also used : SubdocGetResponse(com.couchbase.client.core.msg.kv.SubdocGetResponse) PathMismatchException(com.couchbase.client.core.error.subdoc.PathMismatchException) SubdocGetRequest(com.couchbase.client.core.msg.kv.SubdocGetRequest) CoreIntegrationTest(com.couchbase.client.core.util.CoreIntegrationTest) Test(org.junit.jupiter.api.Test)

Aggregations

PathMismatchException (com.couchbase.client.core.error.subdoc.PathMismatchException)1 SubdocGetRequest (com.couchbase.client.core.msg.kv.SubdocGetRequest)1 SubdocGetResponse (com.couchbase.client.core.msg.kv.SubdocGetResponse)1 CoreIntegrationTest (com.couchbase.client.core.util.CoreIntegrationTest)1 Test (org.junit.jupiter.api.Test)1