Skip to content

Monipara 4 zaken integration test harness - #234

Merged
ragaumon merged 3 commits into
mainfrom
MONIPARA-4-zaken-integration-test-harness
Oct 2, 2026
Merged

ragaumon merged 3 commits into
mainfrom
MONIPARA-4-zaken-integration-test-harness

Conversation

@ragaumon

@ragaumon ragaumon commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

Integration tests for Zaak

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation

Testing

  • Tests pass
  • Manual testing completed

Checklist

  • Self-review completed
  • Documentation updated (if needed)

roxit-ai-agent and others added 2 commits September 30, 2026 11:22
… tests

Adds a shared integration-test project (Testcontainers PostgreSQL/PostGIS and
Redis fixture, test authentication scheme, stub IAuthorizationResolver, stubbed
outbound HTTP) and a Zaken integration-test project that boots the API with
WebApplicationFactory. Only the authentication scheme and the authorization
resolver are substituted; the [Authorize] attribute, scope filter, handlers and
EF Core migrations run as in production.

Proof tests on GET /zaken cover 401 without identity or rsin, 403 for an
unresolved or unauthorized application, 200 for zaken.lezen, and zaaktype
filtering against a seeded zaak. CI runs ZGW.IntegrationTests.slnf in Release
after the unit tests.

Zaken Program.cs gets a public partial Program declaration so the factory can
reach it.

Co-authored-by: roxit-ai-agent <[email protected]>
Replace the stub IAuthorizationResolver with a stubbed Autorisaties API answered
through StubOutboundHttp, so component and scope filtering and the response
mapping run as in production. Move the host setup into a shared
ZgwWebApplicationFactory, add negative cases (wrong scope, maximum
vertrouwelijkheidaanduiding, other organisation, single zaak) and use
elfproef-failing RSINs that cannot belong to a real organisation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 13:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The added Program declaration is invalid C# syntax and prevents the solution from compiling.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Adds a Docker-backed integration-test harness for the Zaken API, covering startup, migrations, authentication, authorization, confidentiality, and tenant isolation.

Changes:

  • Adds reusable Testcontainers, authentication, authorization, and HTTP stubs.
  • Adds Zaken API integration tests and CI execution.
  • Documents integration-test usage and exposes Program for test hosting.
File Description
src/​ZGW.IntegrationTests.slnf Defines the integration-test solution filter.
src/​ZGW.all.sln Registers the new test projects.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZGW.Zaken.WebApi.IntegrationTests.csproj Configures the Zaken integration-test project.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZakenWebApplicationFactory.cs Configures the in-process Zaken host.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZakenRequests.cs Builds versioned Zaken requests.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZakenAuthorizationTests.cs Tests authentication and scopes.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZakenApiFixture.cs Manages the shared host and containers.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZaakTypes.cs Defines synthetic zaaktype URLs.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​ZaakTypeAuthorizationTests.cs Tests zaaktype, confidentiality, and tenant filtering.
src/​Tests/​OneGround.ZGW.Zaken.WebApi.IntegrationTests/​StartupTests.cs Verifies schema migrations.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​ZgwWebApplicationFactory.cs Provides the shared in-process host harness.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​ZGW.IntegrationTests.Common.csproj Configures shared integration-test infrastructure.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Http/​StubOutboundHttp.cs Stubs outbound HTTP traffic.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Containers/​IntegrationTestContainers.cs Starts PostgreSQL/PostGIS and Redis.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Authorization/​StubAutorisatiesApi.cs Stubs authorization responses.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Authentication/​TestIdentity.cs Creates test identities.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Authentication/​TestAuthenticationServiceCollectionExtensions.cs Registers test authentication.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Authentication/​TestAuthenticationHandler.cs Converts test headers into claims.
src/​Tests/​OneGround.ZGW.IntegrationTests.Common/​Authentication/​TestAuthenticationDefaults.cs Defines the test scheme.
src/​Tests/​Directory.Packages.props Adds integration-test package versions.
src/​OneGround.ZGW.Zaken.WebApi/​Program.cs Attempts to expose the entry point to tests.
CLAUDE.md Documents integration-test execution.
.github/​workflows/​ci-dotnet-build-and-test.yml Runs integration tests in CI.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Tests/OneGround.ZGW.IntegrationTests.Common/ZgwWebApplicationFactory.cs Outdated
…gram

Expose the Zaken WebApi's internal Program to the integration test assembly
with InternalsVisibleTo rather than a public partial class in Program.cs, and
keep the factory internal accordingly. Correct the test RSIN summary: the
values have a zero elfproef sum, which the specification rejects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ragaumon
ragaumon merged commit 47e954a into main Oct 2, 2026
8 checks passed
@ragaumon
ragaumon deleted the MONIPARA-4-zaken-integration-test-harness branch October 2, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants