use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method removeXattr.
@Test
@IgnoreWhen(clusterTypes = ClusterType.CAVES)
void removeXattr() {
JsonObject updatedContent = checkSingleOpSuccessXattr(JsonObject.create().put("foo", "bar"), Arrays.asList(MutateInSpec.remove("x.foo").xattr()));
assertFalse(updatedContent.containsKey("foo"));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method arrayInsertUniqueDoesNotExist.
@Test
@IgnoreWhen(clusterTypes = { ClusterType.MOCKED })
void arrayInsertUniqueDoesNotExist() {
JsonObject updatedContent = checkSingleOpSuccess(JsonObject.create().put("foo", JsonArray.from("hello", "world")), Arrays.asList(MutateInSpec.arrayAddUnique("foo", "cruel")));
assertEquals(JsonArray.from("hello", "world", "cruel"), updatedContent.getArray("foo"));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class KeyValueErrorIntegrationTest method verifyTouchingLocked.
/**
* The mock still returns tmpfail but we want to check that the rerty reason is actually locked as it should
* be post 5.0.
*/
@Test
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
void verifyTouchingLocked() {
String validId = UUID.randomUUID().toString();
collection.upsert(validId, JsonObject.create());
collection.getAndLock(validId, Duration.ofSeconds(5));
TimeoutException exception = assertThrows(TimeoutException.class, () -> collection.getAndTouch(validId, Duration.ofSeconds(2), getAndTouchOptions().timeout(Duration.ofSeconds(1))));
assertTrue(exception.context().requestContext().retryReasons().contains(RetryReason.KV_LOCKED));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method createAsDeletedCanInsertOnTop.
@Test
@IgnoreWhen(missesCapabilities = Capabilities.CREATE_AS_DELETED, clusterTypes = ClusterType.CAVES)
void createAsDeletedCanInsertOnTop() {
String docId = docId();
try {
coll.mutateIn(docId, Collections.singletonList(MutateInSpec.insert("foo", "bar").xattr()), MutateInOptions.mutateInOptions().createAsDeleted(true).storeSemantics(StoreSemantics.INSERT));
coll.mutateIn(docId, Collections.singletonList(MutateInSpec.insert("foo", "bar").xattr()), MutateInOptions.mutateInOptions().storeSemantics(StoreSemantics.INSERT));
LookupInResult result = coll.lookupIn(docId, Collections.singletonList(LookupInSpec.get("foo").xattr()));
assertEquals("bar", result.contentAs(0, String.class));
} catch (CouchbaseException err) {
// createAsDeleted flag only supported in 6.5.1+
assertEquals(ResponseStatus.INVALID_REQUEST, err.context().responseStatus());
}
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class SubdocMutateIntegrationTest method removeFullDocAndSetSystemXattr.
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
@Test
void removeFullDocAndSetSystemXattr() {
JsonObject content = JsonObject.create().put("foo", "bar");
String docId = prepare(content);
// leading underscore lets it survive document deletion
String systemXattrName = "_x";
coll.mutateIn(docId, listOf(MutateInSpec.remove(""), MutateInSpec.insert(systemXattrName, "y").xattr()));
LookupInResult result = coll.lookupIn(docId, listOf(LookupInSpec.get(systemXattrName).xattr()), LookupInOptions.lookupInOptions().accessDeleted(true));
assertEquals("y", result.contentAs(0, String.class));
assertTrue(result.isDeleted());
}
Aggregations