Monipara 4 zaken integration test harness - #234
Merged
Merged
Conversation
… 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]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The added Program declaration is invalid C# syntax and prevents the solution from compiling.
Review effort: Balanced
Findings: 1
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
Programfor 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.
…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]>
heuvea
approved these changes
Oct 2, 2026
Grabauskas
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Pull Request
Description
Integration tests for Zaak
Type of Change
Testing
Checklist