use of com.couchbase.client.core.error.DesignDocumentNotFoundException in project couchbase-jvm-clients by couchbase.
the class ViewManagerIntegrationTest method dropAbsentDesignDoc.
@Test
void dropAbsentDesignDoc() {
DesignDocumentNotFoundException e = assertThrows(DesignDocumentNotFoundException.class, () -> views.dropDesignDocument("doesnotexist", DEVELOPMENT));
assertEquals("doesnotexist", e.name());
}
use of com.couchbase.client.core.error.DesignDocumentNotFoundException in project couchbase-jvm-clients by couchbase.
the class ViewManagerIntegrationTest method getAbsentDesignDoc.
@Test
void getAbsentDesignDoc() {
DesignDocumentNotFoundException e = assertThrows(DesignDocumentNotFoundException.class, () -> views.getDesignDocument("doesnotexist", DEVELOPMENT));
assertEquals("doesnotexist", e.name());
}
use of com.couchbase.client.core.error.DesignDocumentNotFoundException in project couchbase-jvm-clients by couchbase.
the class ViewManagerIntegrationTest method publishAbsentDesignDoc.
@Test
void publishAbsentDesignDoc() {
DesignDocumentNotFoundException e = assertThrows(DesignDocumentNotFoundException.class, () -> views.publishDesignDocument("doesnotexist"));
assertEquals("doesnotexist", e.name());
}
use of com.couchbase.client.core.error.DesignDocumentNotFoundException in project couchbase-jvm-clients by couchbase.
the class CoreViewIndexManager method publishDesignDocument.
/**
* Convenience method that gets a the document from the development namespace
* and upserts it to the production namespace.
*
* @param name name of the development design document
* @throws DesignDocumentNotFoundException if the development namespace does not contain a document with the given name
*/
public CompletableFuture<Void> publishDesignDocument(String name, CoreCommonOptions options) {
notNullOrEmpty(name, "Name", () -> new ReducedViewErrorContext(null, null, bucket));
RequestSpan span = buildSpan(TracingIdentifiers.SPAN_REQUEST_MV_PUBLISH_DD, options.parentSpan());
CoreCommonOptions childOptions = options.withParentSpan(span);
return getDesignDocument(name, false, childOptions).thenCompose(doc -> upsertDesignDocument(name, doc, true, childOptions)).whenComplete((r, t) -> span.end());
}
Aggregations