Testing

13 posts in this section

Testing the Repository Layer with @DataJpaTest

Repository tests verify your queries work correctly against a real database. Spring Boot’s @DataJpaTest starts a minimal slice — only JPA components — making tests fast while still catching real SQL issues. @DataJpaTest — What It Loads @DataJpaTest is a test slice annotation: @DataJpaTest class OrderRepositoryTest { // Spring loads: // - Your @Entity classes // - Your @Repository interfaces // - JPA infrastructure (EntityManager, transactions) // - An in-memory H2 database (by default) // // Spring does NOT load: // - @Service, @Controller, @Component classes // - Security configuration // - The full ApplicationContext } Each test method runs in a transaction that’s rolled back at the end — no data pollution between tests.

Continue reading »

Testing the Web Layer with @WebMvcTest and MockMvc

Controller tests verify HTTP mapping, request parsing, validation, serialization, and security — without starting a full server. @WebMvcTest + MockMvc gives you a fast, focused web layer test. @WebMvcTest — What It Loads @WebMvcTest(OrderController.class) class OrderControllerTest { // Spring loads: // - Your @Controller class (and its dependencies) // - DispatcherServlet, MVC configuration // - Jackson ObjectMapper // - Security (if configured) // // Spring does NOT load: // - @Service, @Repository beans // - Database, JPA // // You @MockBean all services } Basic Controller Test @WebMvcTest(OrderController.

Continue reading »

MCP Servers Worth Installing: For Developers, Testers, and DevOps Teams

The MCP (Model Context Protocol) ecosystem now has over 14,000 servers. Most of them you do not need. Installing too many slows responses, inflates your context window with tool definitions that never get used, and turns debugging into a guessing game across a dozen integrations. This guide applies a simple filter: only install a server if it replaces a daily copy-paste workflow. It is organised by role — developers, QA testers, and DevOps/platform engineers — because the right stack is different for each.

Continue reading »