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:
Claude
2026-11-14 15:26:55 +05:30
parent c92977b23d
commit d7497c8ab1
53 changed files with 1547 additions and 0 deletions
@@ -0,0 +1,25 @@
Each class in lab.slices.failing is run through the JUnit Launcher; this is what its exception says.
(The 'Failed to load ApplicationContext' line carries a long configuration dump with object hashes; it is cut at the first '['.
The module directory is shown as <module>.)
== MissingMockBeanFailure
exception chain: IllegalStateException -> UnsatisfiedDependencyException -> NoSuchBeanDefinitionException
top message : Failed to load ApplicationContext for
wiring failure : Error creating bean with name 'bookController' defined in file [<module>/target/classes/lab/slices/BookController.class]: Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'lab.slices.BookService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
== ServiceInDataJpaFailure
exception chain: UnsatisfiedDependencyException -> NoSuchBeanDefinitionException
wiring failure : Error creating bean with name 'lab.slices.failing.ServiceInDataJpaFailure': Unsatisfied dependency expressed through field 'service': No qualifying bean of type 'lab.slices.BookService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
== RepositoryInWebMvcFailure
exception chain: UnsatisfiedDependencyException -> NoSuchBeanDefinitionException
wiring failure : Error creating bean with name 'lab.slices.failing.RepositoryInWebMvcFailure': Unsatisfied dependency expressed through field 'repository': No qualifying bean of type 'lab.slices.BookRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
== PlainComponentInJsonFailure
exception chain: UnsatisfiedDependencyException -> NoSuchBeanDefinitionException
wiring failure : Error creating bean with name 'lab.slices.failing.PlainComponentInJsonFailure': Unsatisfied dependency expressed through field 'audit': No qualifying bean of type 'lab.slices.AuditLogger' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
== ClientWithoutComponentsFailure
exception chain: UnsatisfiedDependencyException -> NoSuchBeanDefinitionException
wiring failure : Error creating bean with name 'lab.slices.failing.ClientWithoutComponentsFailure': Unsatisfied dependency expressed through field 'client': No qualifying bean of type 'lab.slices.IsbnLookupClient' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}