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) <noreply@anthropic.com>
This commit is contained in:
not
2026-07-22 15:57:10 +02:00
co-authored by Claude Opus 4.8
parent 0ba410ad78
commit 24c7ebe8cb
@@ -161,4 +161,32 @@ public sealed class OpenZaakGatewayIntegrationTests(OpenZaakFixture stack)
Assert.Contains(relations.EnumerateArray(), Assert.Contains(relations.EnumerateArray(),
r => r.GetProperty("zaak").GetString() == zaakUrl.ToString()); 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<InvalidOperationException>(
() => gateway.ResolveZaaktypeUrlAsync("NO-SUCH-ZAAKTYPE"));
Assert.Contains("NO-SUCH-ZAAKTYPE", ex.Message);
}
} }