use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method reviveDocumentWithCAS2.
@IgnoreWhen(missesCapabilities = { Capabilities.SUBDOC_REVIVE_DOCUMENT })
@Test
void reviveDocumentWithCAS2() {
String docId = docId();
JsonObject body = JsonObject.create().put("foo", "bar");
coll.insert(docId, body);
MutationResult mr = coll.remove(docId);
coll.mutateIn(docId, Arrays.asList(// Do a dummy op as server complains if do nothing
MutateInSpec.upsert("txn", JsonObject.create()).xattr()), MutateInOptions.mutateInOptions().accessDeleted(true).cas(mr.cas()).storeSemantics(StoreSemantics.REVIVE));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method insertExpandMacroXattrDoNotFlag.
@Test
@IgnoreWhen(clusterTypes = ClusterType.CAVES)
void insertExpandMacroXattrDoNotFlag() {
JsonObject updatedContent = checkSingleOpSuccessXattr(JsonObject.create(), Arrays.asList(MutateInSpec.insert("x.foo", "${Mutation.CAS}").xattr()));
assertEquals("${Mutation.CAS}", updatedContent.getString("foo"));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method reviveDocumentWithCAS3.
@IgnoreWhen(missesCapabilities = { Capabilities.SUBDOC_REVIVE_DOCUMENT })
@Test
void reviveDocumentWithCAS3() {
String docId = docId();
JsonObject body = JsonObject.create().put("foo", "bar");
MutateInResult mr = coll.mutateIn(docId, Collections.singletonList(upsert("txn", JsonObject.create().put("stgd", body).put("baz", "qux")).xattr().createPath()), MutateInOptions.mutateInOptions().createAsDeleted(true).accessDeleted(true).storeSemantics(StoreSemantics.INSERT));
// Create a CAS mismatch
coll.insert(docId, JsonObject.create());
try {
coll.mutateIn(docId, Arrays.asList(new ReplaceBodyWithXattr("txn.stgd"), MutateInSpec.remove("txn").xattr()), MutateInOptions.mutateInOptions().accessDeleted(true).cas(mr.cas()).storeSemantics(StoreSemantics.REVIVE));
fail();
} catch (CasMismatchException ignored) {
// It hits this rather than CannotReviveAliveDocumentException
}
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method twoCommandsOneFails.
@Test
@IgnoreWhen(clusterTypes = ClusterType.CAVES)
void twoCommandsOneFails() {
JsonObject content = JsonObject.create().put("foo1", "bar_orig_1").put("foo2", "bar_orig_2");
String docId = prepare(content);
assertThrows(PathExistsException.class, () -> coll.mutateIn(docId, Arrays.asList(MutateInSpec.insert("foo0", "bar0"), MutateInSpec.insert("foo1", "bar1"), MutateInSpec.remove("foo3"))));
JsonObject updated = getContent(docId);
assertEquals("bar_orig_1", updated.getString("foo1"));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method insertExpandMacroSEQ_NOXattr.
@Test
@IgnoreWhen(clusterTypes = { ClusterType.MOCKED, ClusterType.CAVES })
void insertExpandMacroSEQ_NOXattr() {
JsonObject updatedContent = checkSingleOpSuccessXattr(JsonObject.create(), Arrays.asList(MutateInSpec.insert("x.foo", MutateInMacro.SEQ_NO).xattr()));
assertNotEquals(MutateInMacro.SEQ_NO.value(), updatedContent.getString("foo"));
}
Aggregations