Skip to main content

Notification API Testing

Summary​

Verified API coverage consists of one PowerShell smoke script and one manual request collection. There is no automated API test project, no contract test and no request-level assertion suite in a test framework.

Audience​

Engineers, QA, architects, support and DevOps engineers.

Reference Content​

The verified reference material for this topic is set out in the sections below.

Smoke script​

microservices/scripts/smoke-notification.ps1 is the only automated artifact that exercises the HTTP surface. It boots the service from its build output and drives endpoints in sequence, asserting on responses.

Verified endpoints exercised:

EndpointCovered
GET /notification-templates with filtersYes — both the active-only filter and the tenant-plus-key filter
POST /notification-templatesYes
PUT /notification-templates/{id}Yes
POST /notification-templates/{id}/testYes
POST /notifications/test/dispatchYes
POST /notifications/test/publishYes
GET /notifications/myYes — both the default and unread-only forms
POST /notifications/{id}/readYes
GET /notifications/{id}Yes
GET /notifications/{id}/attemptsYes
POST /notifications/{id}/retryYes
GET /notifications/failedYes
GET /notifications/processed/{eventId}Yes
GET /notifications/auditYes
GET /notifications/statsYes

Fifteen of the seventeen native endpoints are exercised. The two not covered by the script are the service-information root and the health endpoint.

Modes: the script runs a direct mode that drives events synchronously through the dispatch hook, and a broker mode that publishes onto the message bus so the hosted consumer round-trips the event. It can additionally exercise a gateway shadow route against a running or auto-started gateway.

Determinism: the forced-failure flag lets the script drive the failure and retry paths without depending on a real provider outage.

Prerequisites: a reachable PostgreSQL instance, with migrations applied automatically at startup, and for broker mode a reachable message broker.

Manual request collection​

microservices/src/notification-service/notification-service.http is a hand-maintained request collection covering the service root, health, template list, template create, template test, both test hooks, the inbox, read, attempts, retry, failed queue, audit and statistics.

It uses a host variable and placeholder identifiers rather than captured values, so it contains no credentials and no real data. It carries no assertions — it is a developer convenience for manual exercise, not automated coverage.

Coverage gaps in the implemented tests​

Even within the smoke script, the following are not asserted:

  • No negative-path assertions for the four guard clauses — the 400 responses are not exercised.
  • No assertion on 404 responses for absent identifiers.
  • No assertion on the 502 publish-failure path.
  • No assertion on 201 semantics or the location header from template create.
  • No assertion on page-size clamping at either boundary.
  • No cross-tenant isolation assertion on any endpoint.
  • No assertion on the correlation response header.

The following do not exist in the reviewed source and are recorded as recommendations only.

  • An automated API test project using an in-memory or containerized host, asserting status codes and response shapes per endpoint.
  • Negative-path tests for every guard clause and every not-found path.
  • Contract tests pinning the response shape of each endpoint, which would also surface the entity-serialization coupling.
  • Tenant-isolation tests asserting that a caller naming one tenant cannot read another's data — these would currently fail on the unscoped endpoints by design.
  • Authorization tests, which cannot be written until enforcement exists.
  • Gateway routing tests asserting which backend a toggled path reaches.

Classification​

Partial — smoke coverage is Implemented; automated API testing is Not implemented.

Requires confirmation​

Whether the smoke script runs in continuous integration, and who owns API test coverage, require confirmation.

See Also​

Keywords​

  • Notification API
  • API Testing
  • Draft API documentation

Source References​

  • microservices/scripts/smoke-notification.ps1
  • microservices/src/notification-service/notification-service.http
  • microservices/src/notification-service/Api/NotificationEndpoints.cs

Revision Information​

  • Status: Draft
  • Last reviewed: 2026-07-21
  • Review cycle: Quarterly