Test slice
A Spring Boot test that loads only one layer of the application, such as the web layer or the JPA layer, so it starts fast and tests that layer in isolation.
Definition
@WebMvcTest loads controllers, filters and JSON mapping; @DataJpaTest loads entities, repositories and a database; @JsonTest loads only serialization. Beans outside the slice aren't created, so they're replaced with mocks (@MockitoBean). Slices sit between plain unit tests and full @SpringBootTest integration tests.
In practice
A @WebMvcTest checks that POST /orders with an invalid body returns 400 with a problem detail, without a database.