Class MockDataAdmin

Namespace
Kuestenlogik.Bowire.Mock.State
Assembly
Kuestenlogik.Bowire.Mock.dll

The admin surface over a running mock's data (#1100): read, set and reset a bucket, switch a CRUD route on and off, reload the configuration's buckets and routes, so a test starts from a state it names. One implementation behind the mock's own token-gated control surface (/__bowire/mock/…) and the workbench's management API (/api/mocks/{mockId}/data/…).

public static class MockDataAdmin
Inheritance
MockDataAdmin
Inherited Members

Remarks

Request (relative)Answer
GET buckets200, { buckets: [{ name, idProperty, kind, count }] }
POST buckets/reset200, every bucket back at its seed
GET buckets/{name}200, the content; 404 for an unknown bucket
PUT buckets/{name}200, the content replaced; 400 when it is not of the bucket's shape
POST buckets/{name}/reset200, the bucket back at its seed
GET routes200, { routes: [{ path, bucket, enabled }] }
POST routes/enabled{ path, enabled }: 200 with the routes; 404 for an unknown path
POST reload200, buckets and routes read again from the configuration file; 409 when the mock has none

Methods

HandleAsync(HttpContext, MockHandler, string)

Answer an admin request for handler. subPath is the path after the surface's prefix, such as buckets/users/reset.

public static Task HandleAsync(HttpContext ctx, MockHandler handler, string subPath)

Parameters

ctx HttpContext
handler MockHandler
subPath string

Returns

Task