From f363cb1663e2ae09d11e573889aa4b25b95f9e66 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Wed, 22 Jul 2026 16:10:30 +0200 Subject: [PATCH] fix(acceptance): implement the resolve API in the in-memory ZGW gateway (refs #113) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The acceptance InMemoryZaakGateway now implements IZaakGateway's new Resolve{Zaaktype,Informatieobjecttype}UrlAsync, and the "een zaak openen" step configures the ACL by identificatie + points the fake's resolved zaaktype at the scenario URL — the Release build (which compiles tests/acceptance) failed without this. All 17 acceptance + 54 ACL unit tests green. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/acceptance/Steps/EenZaakOpenenSteps.cs | 9 ++++++--- tests/acceptance/Support/InMemoryZaakGateway.cs | 11 +++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/acceptance/Steps/EenZaakOpenenSteps.cs b/tests/acceptance/Steps/EenZaakOpenenSteps.cs index 6dd2fc4..493fb55 100644 --- a/tests/acceptance/Steps/EenZaakOpenenSteps.cs +++ b/tests/acceptance/Steps/EenZaakOpenenSteps.cs @@ -29,9 +29,12 @@ public sealed class EenZaakOpenenSteps Bronorganisatie = values["bronorganisatie"], VerantwoordelijkeOrganisatie = values["verantwoordelijkeOrganisatie"], Vertrouwelijkheidaanduiding = values["vertrouwelijkheidaanduiding"], - ZaaktypeUrl = new Uri(values["zaaktype"]), - InformatieobjecttypeUrl = new Uri("http://openzaak/catalogi/api/v1/informatieobjecttypen/dip"), + ZaaktypeIdentificatie = "BIG-REGISTRATIE", + InformatieobjecttypeOmschrijving = "Diploma", }; + // The ACL resolves the zaaktype by identificatie (S-27); the scenario's zaaktype URL is what + // the catalogus resolves it to, so the created zaak still carries that URL. + _gateway.ResolvedZaaktypeUrl = new Uri(values["zaaktype"]); } [Given("today is \"(.*)\"")] @@ -41,7 +44,7 @@ public sealed class EenZaakOpenenSteps [When("the domain asks the ACL to open a zaak")] public async Task WhenTheDomainAsksTheAclToOpenAZaak() { - var service = new AclService(_gateway, _defaults!, new FixedClock(_today)); + var service = new AclService(_gateway, _defaults!, new CachedZaaktypeCatalog(_gateway, _defaults!), new FixedClock(_today)); _returnedUrl = await service.OpenZaakAsync(_registration!); } diff --git a/tests/acceptance/Support/InMemoryZaakGateway.cs b/tests/acceptance/Support/InMemoryZaakGateway.cs index d16d353..f8fc104 100644 --- a/tests/acceptance/Support/InMemoryZaakGateway.cs +++ b/tests/acceptance/Support/InMemoryZaakGateway.cs @@ -14,6 +14,11 @@ public sealed class InMemoryZaakGateway : IZaakGateway public (Uri Zaak, Uri Zaaktype, DateOnly Datum)? Approved { get; private set; } public (Uri Zaak, Uri Zaaktype, DateOnly Datum)? Cancelled { get; private set; } + // The URLs the catalogus resolves the configured identificatie/omschrijving to (S-27); settable so + // a scenario can pin the zaaktype the ACL should default-fill. + public Uri ResolvedZaaktypeUrl { get; set; } = new("http://openzaak/catalogi/api/v1/zaaktypen/big"); + public Uri ResolvedInformatieobjecttypeUrl { get; set; } = new("http://openzaak/catalogi/api/v1/informatieobjecttypen/dip"); + public Task OpenZaakAsync(ZaakRequest request, CancellationToken ct = default) { Captured = request; @@ -37,4 +42,10 @@ public sealed class InMemoryZaakGateway : IZaakGateway public Task StoreDocumentAsync(DocumentRequest request, CancellationToken ct = default) => Task.FromResult(new Uri("http://openzaak/documenten/api/v1/enkelvoudiginformatieobjecten/acc-doc")); + + public Task ResolveZaaktypeUrlAsync(string identificatie, CancellationToken ct = default) + => Task.FromResult(ResolvedZaaktypeUrl); + + public Task ResolveInformatieobjecttypeUrlAsync(string omschrijving, CancellationToken ct = default) + => Task.FromResult(ResolvedInformatieobjecttypeUrl); }