use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class CreateAsDeletedIntegrationTest method replaceTombstoneWithTxnXattrWithCAS.
@Test
@IgnoreWhen(clusterTypes = ClusterType.CAVES)
void replaceTombstoneWithTxnXattrWithCAS() {
String id = docId();
insertTombstoneWithTxnXattr(coll, id, JsonObject.create());
LookupInResult result = assertIsTombstone(coll, id);
coll.mutateIn(id, Collections.singletonList(MutateInSpec.upsert("txn", JsonObject.create()).xattr()), MutateInOptions.mutateInOptions().storeSemantics(StoreSemantics.REPLACE).cas(result.cas()).accessDeleted(true));
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class CreateAsDeletedIntegrationTest method replaceTombstoneWithTxnXattrWithCASWhichHasChanged.
@Test
@IgnoreWhen(clusterTypes = ClusterType.CAVES)
void replaceTombstoneWithTxnXattrWithCASWhichHasChanged() {
String id = docId();
insertTombstoneWithTxnXattr(coll, id, JsonObject.create());
LookupInResult result = assertIsTombstone(coll, id);
upsertEmptyTombstone(coll, id);
LookupInResult result2 = assertIsTombstone(coll, id);
assertNotEquals(result.cas(), result2.cas());
assertThrows(CasMismatchException.class, () -> {
coll.mutateIn(id, Collections.singletonList(MutateInSpec.insert("txn", JsonObject.create()).xattr()), MutateInOptions.mutateInOptions().cas(// note using the original CAS not the changed one
result.cas()).accessDeleted(true));
});
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class KeyValueIntegrationTest method exists.
/**
* Mock does not support Get Meta, so we need to ignore it there.
*/
@Test
@IgnoreWhen(clusterTypes = ClusterType.MOCKED)
void exists() {
String id = UUID.randomUUID().toString();
assertFalse(collection.exists(id).exists());
MutationResult insertResult = collection.insert(id, "Hello, World");
assertTrue(insertResult.cas() != 0);
ExistsResult existsResult = collection.exists(id);
assertEquals(insertResult.cas(), existsResult.cas());
assertTrue(existsResult.exists());
assertFalse(collection.exists("some_id").exists());
}
use of com.couchbase.client.test.IgnoreWhen in project couchbase-jvm-clients by couchbase.
the class ClusterLevelQueryIntegrationTest method performsClusterLevelQueryWithoutOpenBucket.
@Test
@IgnoreWhen(missesCapabilities = { Capabilities.GLOBAL_CONFIG, Capabilities.QUERY }, clusterTypes = ClusterType.CAVES)
void performsClusterLevelQueryWithoutOpenBucket() {
cluster.waitUntilReady(Duration.ofSeconds(5));
QueryResult result = cluster.query("select 1=1", queryOptions().clientContextId("my-context-id"));
assertEquals(1, result.rowsAsObject().size());
assertEquals("my-context-id", result.metaData().clientContextId());
}
Aggregations