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