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); }