Skip to content

Test/archived flag 409 integration - #61

Merged
amodelandme merged 2 commits into
devfrom
test/archived-flag-409-integration
May 5, 2026
Merged

amodelandme merged 2 commits into
devfrom
test/archived-flag-409-integration

Conversation

@amodelandme

Copy link
Copy Markdown
Owner

Summary

Four integration tests closing the deferred gap from PR #59. Three tests verify that the HTTP API returns 404 when clients attempt to mutate archived flags (PUT, DELETE, and evaluate), documenting that the
repository's !f.IsArchived filter is the primary enforcement mechanism. One synthetic test verifies the FlagDomainException → 409 ProblemDetails middleware contract via a test-only endpoint registered
through IStartupFilter in BanderasApiFactory.

Changes in this PR

  • Integration tests: 3 archived-flag mutation tests (PUT → 404, DELETE → 404, evaluate → 404) in existing test files
  • Middleware contract test: New ArchivedFlag409MiddlewareTests with synthetic FlagDomainException → 409 assertion
  • Test infrastructure: TestDomainExceptionEndpointFilter (IStartupFilter) in BanderasApiFactory registers GET /test/throw-domain-exception
  • Foundation docs: Updated current-state.md and roadmap.md with Phase 2 progress, test counts, and lessons learned

Spec

docs/decisions/test-archived-flag-409-integration/spec.md

Implementation Notes

docs/decisions/test-archived-flag-409-integration/implementation-notes.md

Definition of Done

  • PUT on archived flag returns 404 — integration test passing
  • DELETE on already-archived flag returns 404 — integration test passing
  • POST /api/evaluate on archived flag returns 404 — integration test passing
  • Synthetic FlagDomainException → 409 ProblemDetails shape — integration test passing
  • All existing tests still pass (169/169)
  • dotnet build -p:TreatWarningsAsErrors=true passes
  • CSharpier format check passes
  • No production code modified

Testing

# Run just the 4 new tests
dotnet test Banderas.Tests.Integration \
  --filter "UpdateFlag_ArchivedFlag|ArchiveFlag_AlreadyArchived|Evaluate_ArchivedFlag|FlagDomainException_Returns409" \
  --verbosity normal

# Run full suite
dotnet test Banderas.sln --verbosity normal

@amodelandme
amodelandme merged commit 81470c6 into dev May 5, 2026
9 checks passed
@amodelandme
amodelandme deleted the test/archived-flag-409-integration branch May 5, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant