UNOMI-933/934/935: Add REST input validation integration tests#794
Merged
Conversation
Extend context.json validation tests and add REST create tests so bad payloads return 400 instead of 500.
Accept plain-text InvalidRequestException bodies or JSON badRequest from Jackson mappers on /context.json.
- RestCreateValidationIT: add @after teardown, happy-path 204 tests, retry-aware HTTP client, null-safe body assertion, scoped LogChecker - InputValidationIT: extend garbageBody to cover /context.js, add GET variants for eventEmptySource/Target, null-safe assertInvalidClientDataResponse - Add rule_valid.json and segment_valid.json fixtures
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.
Plain-language summary
Bad JSON sent to Unomi can crash a request with a server error instead of a clear “bad request” response. This change adds automated integration tests that send invalid payloads to the context API and to rule/segment create endpoints, and check that Unomi returns HTTP 400.
These tests lock in the fixes from earlier REST error-handling work so the same bugs do not come back in a release.
What changed
InputValidationITwith UNOMI-933 cases for/context.json.RestCreateValidationITfor POST/cxs/rulesand/cxs/segmentsreturning 400 with{"errorMessage":"badRequest"}.AllITs.Test plan
mvn test-compileinitests/(local)References
UNOMI-933, UNOMI-934, UNOMI-935