CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

apavithraa/springboot-architecture

Skills for creating, testing, reviewing, migrating and guarding Spring Boot 4 projects with Java 25: project scaffolding with architecture patterns, Boot 4 test templates, code review, Boot 3 to 4 migration, and a team harness of build gates and agent hooks.

Quality

93%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Low

Low-risk findings worth noting

Overview
Quality
Evals
Security
Files

boot4-test-toolkit.mdskills/code-reviewer/references/testing/

Spring Boot 4 Test Toolkit

Boot 4 split the test support into modules, and agents most often get these imports wrong. Packages were checked against the Boot 4.1.1 jars on Maven Central (October 2026).

Imports

Annotation / classPackageModule
@SpringBootTest, @TestConfigurationorg.springframework.boot.test.contextspring-boot-test
@WebMvcTest, @AutoConfigureMockMvcorg.springframework.boot.webmvc.test.autoconfigurespring-boot-webmvc-test
@DataJpaTestorg.springframework.boot.data.jpa.test.autoconfigurespring-boot-data-jpa-test
TestEntityManagerorg.springframework.boot.jpa.test.autoconfigurespring-boot-jpa-test
@JdbcTest, @AutoConfigureTestDatabaseorg.springframework.boot.jdbc.test.autoconfigurespring-boot-jdbc-test
@JsonTestorg.springframework.boot.test.autoconfigure.jsonspring-boot-test-autoconfigure
@RestClientTestorg.springframework.boot.restclient.test.autoconfigurespring-boot-restclient-test
@AutoConfigureRestTestClientorg.springframework.boot.resttestclient.autoconfigurespring-boot-resttestclient
@ServiceConnectionorg.springframework.boot.testcontainers.service.connectionspring-boot-testcontainers
MockMvcTesterorg.springframework.test.web.servlet.assertjspring-test
RestTestClientorg.springframework.test.web.servlet.clientspring-test
@MockitoBean, @MockitoSpyBeanorg.springframework.test.context.bean.override.mockitospring-test
@TestBeanorg.springframework.test.context.bean.override.conventionspring-test
DynamicPropertyRegistrar, @Sqlorg.springframework.test.context, …context.jdbcspring-test
PostgreSQLContainer (Testcontainers 2)org.testcontainers.postgresqltestcontainers-postgresql
KafkaContainer (Testcontainers 2)org.testcontainers.kafkatestcontainers-kafka
KafkaConnectionDetailsorg.springframework.boot.kafka.autoconfigurespring-boot-kafka
@EnableWireMock, @ConfigureWireMock, @InjectWireMockorg.wiremock.springorg.wiremock.integrations:wiremock-spring-boot 4.4.3 (not managed by Boot)
@Retryable, @EnableResilientMethodsorg.springframework.resilience.annotationspring-context

Test starters per technology: spring-boot-starter-webmvc-test, spring-boot-starter-data-jpa-test, spring-boot-starter-restclient-test, spring-boot-starter-kafka-test, spring-boot-starter-security-test, all with <scope>test</scope>. Testcontainers support is spring-boot-testcontainers; there is no -starter- for it.

Versions Boot 4.1.1 manages: JUnit Jupiter 6.0.3, Mockito 5.23.0, AssertJ 3.27.7, Awaitility 4.3.0, Testcontainers 2.0.5. Don't pin them yourself.

Boot 4 changes agents miss

  • @MockBean and @SpyBean are gone: use @MockitoBean, @MockitoSpyBean. TestRestTemplate is on its way out: use RestTestClient.
  • @SpringBootTest no longer auto-configures HTTP test clients. Add @AutoConfigureRestTestClient or @AutoConfigureMockMvc.
  • RestTestClient sends a request body with .body(object). .bodyValue(...) is WebTestClient's method and does not compile on RestTestClient.
  • The Testcontainers 2 module classes take no type parameter: PostgreSQLContainer, not PostgreSQLContainer<?>. GenericContainer<?> keeps it.
  • Spring Framework 7 pauses cached contexts between uses, so scheduled tasks and listeners in an idle cached context no longer interfere with other tests.
  • One shared container configuration for the whole suite: ../../../writing-springboot-tests/assets/testcontainers-configuration.java.

PIT

Use PIT before breaking code by hand, for any class with plain unit tests. In a trial on an OrderService (39 mutants), PIT took 6 seconds. Breaking each line of the same class by hand, through Maven and a container per run, did not finish in 10 minutes.

Add ../../../writing-springboot-tests/assets/pitest-plugin.xml (pitest-maven 1.30.1, pitest-junit5-plugin 1.2.3, checked October 2026), then run it for one class:

./mvnw test-compile org.pitest:pitest-maven:mutationCoverage \
  -DtargetClasses=com.example.orders.domain.OrderService \
  -DtargetTests='com.example.orders.domain.*Test'

The report is in target/pit-reports/index.html. Gradle: the info.solidsoft.pitest plugin with junit5PluginVersion set; the parameters have the same names.

  • Start with unit and slice tests. PIT runs the tests once per mutant, so tests that start containers make it very slow.
  • In a test with a cached Spring context, mutants in constructors and @PostConstruct code survive however good the tests are: each bean is built once. A surviving "Removed assignment to member variable" there is this artifact, not a gap.
  • Don't chase 100%. Chase survivors in the logic the change is about, and name equivalent mutants.

tile.json