Completes the re-source (ADR-0030): the Event Subscriber's abonnement moves from `zaken` to `objecten`, in both the local stack's `nrc-subscribe` and the CI projection check. The OpenZaak → NRC check keeps its own `zaken` abonnement — OpenZaak still publishes, nothing in the product listens. - register-abonnement.py subscribes to `objecten`, and now treats the kanaal as part of "already current" — an abonnement left from before this slice points at the right callback but the wrong kanaal, and would never have been replaced on IP alone. - run-projection-check.sh opens its zaak *through the ACL* instead of straight against OpenZaak, because the ACL is what writes the register record the projection is now derived from. A zaak created behind the ACL's back produces no row — which is the re-source working. - The acceptance scenario is restated in register terms and gains the approval case: the same row moving INGEDIEND → INGESCHREVEN is now one registration's record being updated, not two unrelated ZGW events.
58 lines
2.4 KiB
C#
58 lines
2.4 KiB
C#
using Acceptance.Support;
|
|
using EventSubscriber.Application;
|
|
using Reqnroll;
|
|
using Xunit;
|
|
|
|
namespace Acceptance.Steps;
|
|
|
|
/// <summary>Bindings for <c>RegisterProjectieBijwerken.feature</c> (S-06, re-sourced by S-19b-2).
|
|
/// Reqnroll creates one instance per scenario, so instance fields hold scenario-scoped state.</summary>
|
|
[Binding]
|
|
public sealed class RegisterProjectieBijwerkenSteps
|
|
{
|
|
private const string ObjectBase = "http://objecten.local:8000/api/v2/objects/";
|
|
|
|
private readonly InMemoryNotificationLog _log = new();
|
|
private readonly InMemoryProjectionStore _store = new();
|
|
private readonly InMemoryRegisterRecordClient _register = new();
|
|
private readonly NotificationProjector _projector;
|
|
private Notification? _notification;
|
|
|
|
public RegisterProjectieBijwerkenSteps()
|
|
=> _projector = new NotificationProjector(_log, _store, _register);
|
|
|
|
[Given("registration \"(.*)\" is recorded in the register with status \"(.*)\"")]
|
|
[When("registration \"(.*)\" is recorded in the register with status \"(.*)\"")]
|
|
public void RegistrationIsRecorded(string id, string status)
|
|
{
|
|
// The ACL upserts one object per registration, so submit and approval share an object URL.
|
|
var objectUrl = ObjectBase + id;
|
|
_register.Records[objectUrl] = new RegisterRecord(id, status, "REG-" + id);
|
|
_notification = new Notification("objecten", "object", "create", new Uri(objectUrl), new Uri(objectUrl));
|
|
}
|
|
|
|
[Given("the register notification is delivered to the event subscriber")]
|
|
[When("the register notification is delivered to the event subscriber")]
|
|
public Task TheNotificationIsDelivered()
|
|
=> _projector.HandleAsync(_notification!);
|
|
|
|
[When("the same register notification is delivered again")]
|
|
public Task TheSameNotificationIsDeliveredAgain()
|
|
=> _projector.HandleAsync(_notification!);
|
|
|
|
[Then("the register projection contains a row for \"(.*)\" with status \"(.*)\"")]
|
|
public async Task ThenTheProjectionContainsARowWithStatus(string id, string status)
|
|
{
|
|
var entry = Assert.Single(await _store.AllAsync());
|
|
Assert.Equal(id, entry.Id);
|
|
Assert.Equal(status, entry.Status);
|
|
}
|
|
|
|
[Then("the register projection contains exactly one row for \"(.*)\"")]
|
|
public async Task ThenTheProjectionContainsExactlyOneRowFor(string id)
|
|
{
|
|
await _store.AllAsync();
|
|
Assert.Single(_store.RowsFor(id));
|
|
}
|
|
}
|