Skip to content

Commit

Permalink
chore(deps): Bump org.springframework.boot from 3.3.5 to 3.4.0 (sprin…
Browse files Browse the repository at this point in the history
…gwolf#1101)

* chore(deps): Bump org.springframework.boot from 3.3.5 to 3.4.0

Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.3.5 to 3.4.0.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](spring-projects/spring-boot@v3.3.5...v3.4.0)

---
updated-dependencies:
- dependency-name: org.springframework.boot
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: migrate to spring boot 3.4

* chore: migrate to spring boot 3.4

* chore: migrate to spring boot 3.4

* chore: migrate to spring boot 3.4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Timon Back <timonback@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and timonback authored Dec 13, 2024
1 parent 124bdaa commit 4861d50
Show file tree
Hide file tree
Showing 18 changed files with 182 additions and 163 deletions.
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ owasp-dependencycheck = "11.1.1"
protobuf = "4.29.1"
protobuf-plugin = "0.9.4"
spotless = "6.25.0"
spring-boot-plugin = "3.3.5"
spring-cloud = "2023.0.3" # not managed by spring-boot-dependencies
spring-cloud-stream = "4.1.3" # not managed by spring-boot-dependencies
spring-boot-plugin = "3.4.0"
spring-cloud = "2024.0.0" # not managed by spring-boot-dependencies
spring-cloud-stream = "4.1.4" # not managed by spring-boot-dependencies

[libraries]
activemq-broker = { module = "org.apache.activemq:activemq-broker", version.ref = "activemq" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.Order;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.Map;
Expand Down Expand Up @@ -55,16 +55,16 @@
})
class DefaultAsyncApiServiceIntegrationTest {

@MockBean
@MockitoBean
private ChannelsService channelsService;

@MockBean
@MockitoBean
private OperationsService operationsService;

@MockBean
@MockitoBean
private ComponentsService componentsService;

@MockBean
@MockitoBean
private AsyncApiGroupService groupService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.lang.reflect.Method;
Expand All @@ -25,7 +25,7 @@ class DefaultBeanMethodsScannerIntegrationTest {
@Autowired
private DefaultBeanMethodsScanner beanMethodsScanner;

@MockBean
@MockitoBean
private ComponentClassScanner componentClassScanner;

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.core.env.Environment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import java.util.Set;

Expand All @@ -34,7 +34,7 @@
TestOtherConditionalComponent.class
})
class SpringwolfClassScannerIntegrationTest {
@MockBean
@MockitoBean
private AsyncApiDocketService asyncApiDocketService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.core.env.Environment;
import org.springframework.core.env.StandardEnvironment;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoBean;

import java.util.Set;

Expand All @@ -32,7 +32,7 @@
TestOtherConditionalComponent.class
})
class ComponentClassScannerIntegrationTest {
@MockBean
@MockitoBean
private AsyncApiDocketService asyncApiDocketService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.Set;
Expand All @@ -21,7 +21,7 @@
@ContextConfiguration(classes = {ConfigurationClassScanner.class, ComponentClassScanner.class})
class ConfigurationClassScannerIntegrationTest {

@MockBean
@MockitoBean
private AsyncApiDocketService asyncApiDocketService;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoSpyBean;
import org.testcontainers.containers.DockerComposeContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
Expand Down Expand Up @@ -53,7 +53,7 @@ public class AmqpProducerSystemTest {
@Autowired
SpringwolfAmqpProducer springwolfAmqpProducer;

@SpyBean
@MockitoSpyBean
ExampleConsumer exampleConsumer;

@Container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoSpyBean;
import org.testcontainers.containers.DockerComposeContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
Expand Down Expand Up @@ -43,7 +43,7 @@ public class JmsProducerSystemTest {
@Autowired
SpringwolfJmsProducer springwolfJmsProducer;

@SpyBean
@MockitoSpyBean
ExampleConsumer exampleConsumer;

@Value("${spring.activemq.broker-url}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.test.context.bean.override.mockito.MockitoSpyBean;
import org.testcontainers.containers.DockerComposeContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
Expand Down Expand Up @@ -37,7 +37,7 @@ public class SqsProducerSystemTest {
@Autowired
SpringwolfSqsProducer springwolfSqsProducer;

@SpyBean
@MockitoSpyBean
ExampleConsumer exampleConsumer;

@Container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import io.github.springwolf.core.asyncapi.components.ComponentsService;
import io.github.springwolf.core.asyncapi.scanners.classes.SpringwolfClassScanner;
import io.github.springwolf.core.asyncapi.scanners.common.headers.HeaderClassExtractor;
import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadAsyncOperationService;
import io.github.springwolf.core.asyncapi.scanners.common.payload.PayloadMethodParameterService;
import io.github.springwolf.core.configuration.docket.AsyncApiDocketService;
import io.github.springwolf.core.controller.PublishingPayloadCreator;
import io.github.springwolf.plugins.amqp.controller.SpringwolfAmqpController;
import io.github.springwolf.plugins.amqp.producer.SpringwolfAmqpProducer;
Expand All @@ -16,10 +14,9 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.MockBeans;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.util.StringValueResolver;

Expand All @@ -34,7 +31,7 @@ public class SpringwolfAmqpProducerConfigurationIntegrationTest {
classes = {
SpringwolfAmqpAutoConfiguration.class,
PublishingPayloadCreator.class,
ObjectMapperTestConfiguration.class
ObjectMapperTestConfiguration.class,
})
@TestPropertySource(
properties = {
Expand All @@ -46,20 +43,8 @@ public class SpringwolfAmqpProducerConfigurationIntegrationTest {
"springwolf.docket.servers.test-protocol.host=some-server:1234",
"springwolf.plugin.amqp.publishing.enabled=true"
})
@MockBeans(
value = {
@MockBean(AsyncApiService.class),
@MockBean(RabbitTemplate.class),
@MockBean(SpringwolfClassScanner.class),
@MockBean(ComponentsService.class),
@MockBean(PayloadAsyncOperationService.class),
@MockBean(PayloadMethodParameterService.class),
@MockBean(HeaderClassExtractor.class),
@MockBean(AsyncApiDocketService.class),
@MockBean(StringValueResolver.class),
})
@Nested
class AmqpProducerWillBeCreatedIfEnabledTest {
class AmqpProducerWillBeCreatedIfEnabledTest extends MockBeanConfiguration {
@Autowired
private Optional<SpringwolfAmqpProducer> springwolfAmqpProducer;

Expand All @@ -78,7 +63,7 @@ void springwolfAmqpProducerShouldBePresentInSpringContext() {
classes = {
SpringwolfAmqpAutoConfiguration.class,
PublishingPayloadCreator.class,
ObjectMapperTestConfiguration.class
ObjectMapperTestConfiguration.class,
})
@TestPropertySource(
properties = {
Expand All @@ -90,19 +75,8 @@ void springwolfAmqpProducerShouldBePresentInSpringContext() {
"springwolf.docket.servers.test-protocol.host=some-server:1234",
"springwolf.plugin.amqp.publishing.enabled=false"
})
@MockBeans(
value = {
@MockBean(AsyncApiService.class),
@MockBean(RabbitTemplate.class),
@MockBean(SpringwolfClassScanner.class),
@MockBean(ComponentsService.class),
@MockBean(PayloadAsyncOperationService.class),
@MockBean(PayloadMethodParameterService.class),
@MockBean(HeaderClassExtractor.class),
@MockBean(StringValueResolver.class),
})
@Nested
class AmqpProducerWillNotBeCreatedIfDisabledTest {
class AmqpProducerWillNotBeCreatedIfDisabledTest extends MockBeanConfiguration {
@Autowired
private Optional<SpringwolfAmqpProducer> springwolfAmqpProducer;

Expand All @@ -115,4 +89,32 @@ void springwolfAmqpProducerShouldNotBePresentInSpringContext() {
assertThat(springwolfAmqpController).isNotPresent();
}
}

/**
* Introduced due to migration of spring boot 3.3 -> 3.4 and @MockBean deprecation
*
* feature request: https://github.com/spring-projects/spring-framework/issues/33925
*/
class MockBeanConfiguration {
@MockitoBean
private SpringwolfClassScanner springwolfClassScanner;

@MockitoBean
private ComponentsService componentsService;

@MockitoBean
private HeaderClassExtractor headerClassExtractor;

@MockitoBean
private PayloadMethodParameterService payloadMethodParameterService;

@MockitoBean
private StringValueResolver stringValueResolver;

@MockitoBean
private AsyncApiService asyncApiService;

@MockitoBean
private RabbitTemplate rabbitTemplate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.cloud.stream.config.BindingProperties;
import org.springframework.cloud.stream.config.BindingServiceProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.bean.override.mockito.MockitoBean;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.Collections;
Expand Down Expand Up @@ -97,7 +97,7 @@
@Import(CloudStreamFunctionChannelsScannerIntegrationTest.Configuration.class)
class CloudStreamFunctionChannelsScannerIntegrationTest {

@MockBean
@MockitoBean
private BindingServiceProperties bindingServiceProperties;

@Autowired
Expand Down
Loading

0 comments on commit 4861d50

Please sign in to comment.