
unit-test-controller-layer
Provides patterns for unit testing REST controllers
by giuseppe-trisciuoglioFree
Description
Unit test controller layer is an agent skill for writing unit tests for REST controllers in Spring. It uses MockMvc and @WebMvcTest to test @RestController and @Controller classes in isolation, with their service dependencies mocked. The tests cover request and response handling, HTTP status codes, request parameter binding, validation, content negotiation, response headers and exception handling. The skill is useful when you want an endpoint checked without starting the whole application or calling a real database. It applies to requests such as writing controller tests, testing API endpoints, or verifying a web layer in isolation. The agent follows the patterns to generate tests for the controllers in your project. Because the tests mock the service layer, they check the web layer only, so keep separate tests for the service logic.…
Highlights
- MockMvc tests for REST controllers
- @WebMvcTest slices
- Status codes and parameter binding
- Validation and content negotiation
- Exception handling tests with mocked services
Ratings & Reviews
No ratings yet
Be the first to rate unit-test-controller-layer.
People also visit

unit-test-wiremock-rest-api
Provides patterns for unit testing external REST APIs using WireMock
unit-test-controller-layer FAQ
What does the skill test?
The web layer of Spring controllers: request and response mapping, status codes, validation, headers and exceptions.
How do I install it?
Run npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill unit-test-controller-layer.
Does it need a database?
No. The controller tests mock the service dependencies, so they run in isolation.
Has the skill been security audited?
Yes. Gen Agent Trust Hub shows Pass, Socket shows Pass and Snyk shows Pass.
What are the best unit-test-controller-layer alternatives?
Popular alternatives to unit-test-controller-layer include unit-test-exception-handler, test-master and unit-test-wiremock-rest-api. See all unit-test-controller-layer alternatives












