GH-198 - Upgrade to Spring Boot 3.1 snapshots.
Switch verification of mock beans as Mockito 5.3.0 uses a different MockMaker by default that doesn't add the explicit interface we have previously checked for. Remove obsolete init- and destroy method declarations from service bean definitions in examples.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -46,7 +46,7 @@
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring.version>6.0.8</spring.version> <!-- For Javadoc links only -->
|
||||
<spring-asciidoctor-backends.version>0.0.5</spring-asciidoctor-backends.version>
|
||||
<spring-boot.version>3.0.6</spring-boot.version>
|
||||
<spring-boot.version>3.1.0-SNAPSHOT</spring-boot.version>
|
||||
|
||||
</properties>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.1.0-RC1</version>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<relativePath />
|
||||
</parent>
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ class ApplicationIntegrationTests {
|
||||
@TestConfiguration
|
||||
static class Infrastructure {
|
||||
|
||||
@Bean
|
||||
@ServiceConnection
|
||||
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||
PostgreSQLContainer<?> database() {
|
||||
return new PostgreSQLContainer<>("postgres:15.2");
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ class ApplicationIntegrationTests {
|
||||
@TestConfiguration
|
||||
static class MongoDbInfrastructureConfiguration {
|
||||
|
||||
@Bean
|
||||
@ServiceConnection
|
||||
@Bean(initMethod = "start", destroyMethod = "stop")
|
||||
MongoDBContainer mongoDBContainer() {
|
||||
return new MongoDBContainer("mongo:6.0.3");
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.internal.creation.bytebuddy.MockAccess;
|
||||
import org.mockito.Mockito;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigurationPackages;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
@@ -62,7 +62,7 @@ class ModuleBTest {
|
||||
|
||||
context.getBean(ServiceComponentB.class);
|
||||
|
||||
assertThat(context.getBean(ServiceComponentA.class)).isInstanceOf(MockAccess.class);
|
||||
assertThat(Mockito.mockingDetails(context.getBean(ServiceComponentA.class)).isMock()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user