use of com.couchbase.client.java.kv.ExistsOptions in project spring-data-couchbase by spring-projects.
the class ReactiveCouchbaseTemplateQueryCollectionIntegrationTests method existsByIdOptions.
@Test
public void existsByIdOptions() {
// 1 - Options
ExistsOptions options = ExistsOptions.existsOptions().timeout(Duration.ofNanos(10));
assertThrows(UnambiguousTimeoutException.class, () -> template.existsById().inScope(otherScope).inCollection(otherCollection).withOptions(options).one(vie.getId()).block());
}
use of com.couchbase.client.java.kv.ExistsOptions in project spring-data-couchbase by spring-projects.
the class ReactiveCouchbaseTemplateQueryCollectionIntegrationTests method existsByIdOther.
@Test
public void existsByIdOther() {
// 1
GetOptions options = GetOptions.getOptions().timeout(Duration.ofSeconds(10));
ExistsOptions existsOptions = ExistsOptions.existsOptions().timeout(Duration.ofSeconds(10));
Airport saved = template.insertById(Airport.class).inScope(otherScope).inCollection(otherCollection).one(vie.withIcao("lowg")).block();
try {
Boolean exists = template.existsById().inScope(otherScope).inCollection(otherCollection).withOptions(existsOptions).one(vie.getId()).block();
assertTrue(exists, "Airport should exist: " + vie.getId());
} finally {
template.removeById().inScope(otherScope).inCollection(otherCollection).one(vie.getId()).block();
}
}
Aggregations