From 24c7ebe8cb8e807a529aae5e7c17700e9de859c1 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Wed, 22 Jul 2026 15:57:10 +0200 Subject: [PATCH] test(acl): live integration tests for catalogus resolution by business key (refs #113) Assert the gateway resolves the published BIG-REGISTRATIE zaaktype + Diploma informatieobjecttype against a real seeded OpenZaak, and that an unknown identificatie throws a clear error. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../OpenZaakGatewayIntegrationTests.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs b/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs index d59d0d9..70c84bf 100644 --- a/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs +++ b/services/acl/Acl.IntegrationTests/OpenZaakGatewayIntegrationTests.cs @@ -161,4 +161,32 @@ public sealed class OpenZaakGatewayIntegrationTests(OpenZaakFixture stack) Assert.Contains(relations.EnumerateArray(), r => r.GetProperty("zaak").GetString() == zaakUrl.ToString()); } + + [Fact] + public async Task Resolves_the_published_zaaktype_and_diploma_informatieobjecttype_by_business_key() + { + var expectedZaaktype = await stack.FindPublishedBigZaaktypeAsync(); + Assert.True(expectedZaaktype is not null, + "No published BIG-REGISTRATIE zaaktype found — seed the stack with OZ_PUBLISH=1."); + var expectedInformatieobjecttype = await stack.FindPublishedDiplomaInformatieobjecttypeAsync(); + Assert.True(expectedInformatieobjecttype is not null, + "No published Diploma informatieobjecttype found — seed the stack with OZ_PUBLISH=1."); + + var gateway = new OpenZaakGateway(stack.Http, stack.Options); + + // The ACL discovers both URLs from the live Catalogi API by their stable business keys (S-27), + // matching what the fixture found independently — no pinned URL needed. + Assert.Equal(expectedZaaktype, await gateway.ResolveZaaktypeUrlAsync("BIG-REGISTRATIE")); + Assert.Equal(expectedInformatieobjecttype, await gateway.ResolveInformatieobjecttypeUrlAsync("Diploma")); + } + + [Fact] + public async Task Resolving_an_unknown_zaaktype_identificatie_throws_a_clear_error() + { + var gateway = new OpenZaakGateway(stack.Http, stack.Options); + + var ex = await Assert.ThrowsAsync( + () => gateway.ResolveZaaktypeUrlAsync("NO-SUCH-ZAAKTYPE")); + Assert.Contains("NO-SUCH-ZAAKTYPE", ex.Message); + } }