spring-test-slices: Spring Boot 4.1.2 test slices lab (@WebMvcTest, @JsonTest, @RestClientTest, @DataJpaTest vs @SpringBootTest)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7Jbw5CxUQ13D7gn25
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package lab.slices.failing;
|
||||
|
||||
import lab.slices.BookController;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.webmvc.test.autoconfigure.WebMvcTest;
|
||||
|
||||
/** Fails on purpose: the controller needs a BookService and nothing in a @WebMvcTest provides one. */
|
||||
@Tag("failure-demo")
|
||||
@WebMvcTest(BookController.class)
|
||||
public class MissingMockBeanFailure {
|
||||
@Test
|
||||
void neverRuns() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user