Provides patterns for unit testing JSON serialization/deserialization with Jackson and `@JsonTest`. Validates JSON mapping, custom serializers, date formats, and polymorphic types.
SkillScore100Maintained
Automatic
◆QA & Test Engineering pack
Last verified 8/21/2026
What it changes
Passed 22 of 22 test cases with the skill, and 16 of 22 without it.
Without skill73%
With skill100%
Checks it passed that the model alone missed
Annotates the test class with @JsonTest.
Injects a JacksonTester field for PaymentMethod.
Parses JSON containing a reviews array with JacksonTester.
and 5 more in the full report
6 fixed16 passed either way0 still failing0 broke
Pass-rate lift
+27 pp
Tokens
+108%
Agent turns
0%
Response time
-26%
Model gemini-3.6-flashMeasured 8/21/2026v122 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 6
Prompt
A Product object has a List<Review> reviews field. Write a Spring test method that parses JSON containing a reviews array with two items and asserts the size of the reviews list on the deserialized object.
What was checked, without and with the skill
Checked
Without skill
With skill
Parses JSON containing a reviews array with JacksonTester.
Missed
Passed
Asserts that the reviews list size on the parsed object is equal to 2.
Passed
Passed
case-07 · gemini-3.6-flash · 8/21/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md281 linessingle file
Unit Testing JSON Serialization with @JsonTest
Overview
Provides patterns for unit testing JSON serialization and deserialization using Spring's @JsonTest and Jackson. Covers POJO mapping, custom serializers, field name mappings, nested objects, date/time formatting, and polymorphic types.
When to Use
Testing JSON serialization/deserialization of DTOs
Verifying custom Jackson serializers/deserializers
Validating @JsonProperty, @JsonIgnore, and field name mappings
Testing date/time format handling (LocalDateTime, Date)
Testing null handling and missing fields
Testing polymorphic type deserialization
Instructions
Annotate test class with @JsonTest → Enables JacksonTester auto-configuration
Autowire JacksonTester for target type → Provides type-safe JSON assertions
Test serialization → Call json.write(object) and assert JSON paths with extractingJsonPath*
Test deserialization → Call json.parse(json) or json.parseObject(json) and assert object state
Validate round-trip → Serialize, then deserialize, verify same data (if object is properly comparable)