test(tests): API response contract tests — Phase 2 - #65
Merged
Merged
Conversation
- Correct postStartCommand network name from bandera_default to featureflagservice_default - Add http launch profile that omits the connection string env var, letting appsettings.Development.json resolve Host=postgres via Docker DNS - Rename old http profile to local for running outside the container Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ests Add ContractTests.cs with 5 integration tests that parse raw JsonDocument to assert exact camelCase field names, enum-as-string serialization, and Content-Type on all success response shapes (FlagResponse, FlagResponse[], EvaluationResponse, FlagHealthAnalysisResponse + FlagAssessment). Extend IntegrationTestBase with ReadRawJsonAsync helper and add camelCase field-name assertions to ReadProblemDetailsAsync and ReadValidationProblemDetailsAsync so every error-path test in the suite covers the ProblemDetails wire contract for free. 278/278 tests passing (203 unit + 75 integration).
…tion doc updates Spec: Docs/Decisions/contract-tests/spec.md Implementation notes: Docs/Decisions/contract-tests/implementation-notes.md current-state.md: status updated, test counts updated (278 green), completed work added, next tasks refreshed, lesson learned added. roadmap.md: Phase 2 contract tests item checked, current focus updated.
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.
Summary
Five new integration tests in
ContractTests.cspin the JSON wire shape of every API success response using rawJsonDocumentassertions — not typed deserialization. Two shared helpermethods in
IntegrationTestBase(ReadProblemDetailsAsyncandReadValidationProblemDetailsAsync) were extended to assert camelCase field-name presence on all error responses. A newReadRawJsonAsynchelper was added toIntegrationTestBaseas shared infrastructure for the contract tests and future tests that need raw JSON access.Changes in this PR
ContractTests.cs(new): 5 integration tests coveringFlagResponse,FlagResponse[],EvaluationResponse, andFlagHealthAnalysisResponse+FlagAssessmentwireshapes
IntegrationTestBase.cs(modified):ReadRawJsonAsynchelper; camelCase field-name assertions added toReadProblemDetailsAsyncandReadValidationProblemDetailsAsynccurrent-state.md,roadmap.mdSpec
Docs/Decisions/contract-tests/spec.mdImplementation Notes
Docs/Decisions/contract-tests/implementation-notes.mdDefinition of Done
Testing
dotnet test Banderas.Tests.Integration --filter "FullyQualifiedName~ContractTests"