Unit testing JSON serialization and deserialization with Spring's @JsonTest and Jackson.
Works with
Covers serialization/deserialization of POJOs, custom serializers/deserializers, field name mappings with @JsonProperty , and null handling using JacksonTester for type-safe assertions
Includes patterns for testing nested objects, lists, date/time formatting, and polymorphic types with @JsonTypeInfo
Provides Maven and Gradle setup, best practices for avoiding circular references and null inclusio
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionunit-test-json-serializationExecute the skills CLI command in your project's root directory to begin installation:
Fetches unit-test-json-serialization from giuseppe-trisciuoglio/developer-kit and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate unit-test-json-serialization. Access via /unit-test-json-serialization in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
194
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
194
stars
@JsonTestProvides 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.
@JsonProperty, @JsonIgnore, and field name mappings@JsonTest → Enables JacksonTester auto-configurationjson.write(object) and assert JSON paths with extractingJsonPath*json.parse(json) or json.parseObject(json) and assert object state<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
dependencies {
implementation("org.springframework.boot:spring-boot-starter-json")
testImplementation("org.springframework.boot:spring-boot-starter-test")
}
@JsonTest
class UserDtoJsonTest {
@Autowired
private JacksonTester<UserDto> json;
@Test
void shouldSerializeUserToJson() throws Exception {
UserDto user = new UserDto(1L, "Alice", "[email protected]", 25);
JsonContent<UserDto> result = json.write(user);
result
.extractingJsonPathNumberValue("$.id").isEqualTo(1)
.extractingJsonPathStringValue("$.name").isEqualTo("Alice")
.extractingJsonPathStringValue("$.email").isEqualTo("[email protected]")
.extractingJsonPathNumberValue("$.age").isEqualTo(25);
}
@Test
void shouldDeserializeJsonToUser() throws Exception {
String json_content = "{\"id\":1,\"name\":\"Alice\",\"email\":\"[email protected]\",\"age\":25}";
UserDto user = json.parse(json_content).getObject();
assertThat(user.getId()).isEqualTo(1L);
assertThat(user.getName()).isEqualTo("Alice");
assertThat(user.getEmail()).isEqualTo("[email protected]");
assertThat(user.getAge()).isEqualTo(25);
}
@Test
void shouldHandleNullFields() throws Exception {
String json_content = "{\"id\":1,\"name\":null,\"email\":\"[email protected]\"}";
UserDto user = json.parse(json_content).getObject();
assertThat(user.getName()).isNull();
}
}
public class Order {
@JsonProperty("order_id")
private Long id;
@JsonProperty("total_amount")
private BigDecimal amount;
@JsonIgnore
private String internalNote;
}
@JsonTest
class OrderJsonTest {
@Autowired
private JacksonTester<Order> json;
@Test
void shouldMapJsonPropertyNames() throws Exception {
String json_content = "{\"order_id\":123,\"total_amount\":99.99}";
Order order = json.parse(json_content).getObject();
assertThat(order.getId()).isEqualTo(123L);
assertThat(order.getAmount()).isEqualByComparingTo(new BigDecimal("99.99"));
}
@Test
void shouldIgnoreJsonIgnoreFields() throws Exception {
Order order = new Order(123L, new BigDecimal("99.99"));
order.setInternalNote("Secret");
assertThat(json.write(order).json).doesNotContain("internalNote");
}
}
public class Product {
private Long id;
private String name;
private Category category;
private List<Review> reviews;
}
@JsonTest
class ProductJsonTest {
@Autowired
Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
giuseppe-trisciuoglio/developer-kit
giuseppe-trisciuoglio/developer-kit
giuseppe-trisciuoglio/developer-kit
giuseppe-trisciuoglio/developer-kit
giuseppe-trisciuoglio/developer-kit
cexll/myclaude
Keeps context tight: unit-test-json-serialization is the kind of skill you can hand to a new teammate without a long onboarding doc.
We added unit-test-json-serialization from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
unit-test-json-serialization is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
Registry listing for unit-test-json-serialization matched our evaluation — installs cleanly and behaves as described in the markdown.
Solid pick for teams standardizing on skills: unit-test-json-serialization is focused, and the summary matches what you get after install.
unit-test-json-serialization reduced setup friction for our internal harness; good balance of opinion and flexibility.
Useful defaults in unit-test-json-serialization — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
We added unit-test-json-serialization from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
I recommend unit-test-json-serialization for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
unit-test-json-serialization is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
showing 1-10 of 63