Skip to content

Commit 2fa5448

Browse files
authored
Adapt to restructuring changes in Spring Boot 4.0 (#281)
This commit updates imports to adapt to Spring Boot 4.0's restructuring. This commit also stops using some APIs that have been deprecated since Spring Boot 3.4. Signed-off-by: Andy Wilkinson <[email protected]>
1 parent 537c058 commit 2fa5448

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

spring-cloud-bus-tests/src/test/java/org/springframework/cloud/bus/jackson/BusJacksonIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@
3131
import org.springframework.boot.SpringBootConfiguration;
3232
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
3333
import org.springframework.boot.test.context.SpringBootTest;
34-
import org.springframework.boot.test.web.client.TestRestTemplate;
35-
import org.springframework.boot.test.web.server.LocalServerPort;
34+
import org.springframework.boot.web.server.test.LocalServerPort;
35+
import org.springframework.boot.web.server.test.client.TestRestTemplate;
3636
import org.springframework.cloud.bus.ServiceMatcher;
3737
import org.springframework.cloud.bus.event.RemoteApplicationEvent;
3838
import org.springframework.context.ApplicationEventPublisher;

spring-cloud-bus/src/main/java/org/springframework/cloud/bus/jackson/BusJacksonAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,6 @@
3333
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
3434
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3535
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
36-
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
3736
import org.springframework.cloud.bus.BusAutoConfiguration;
3837
import org.springframework.cloud.bus.ConditionalOnBusEnabled;
3938
import org.springframework.cloud.bus.endpoint.RefreshBusEndpoint;
@@ -59,7 +58,8 @@
5958
@Configuration(proxyBeanMethods = false)
6059
@ConditionalOnBusEnabled
6160
@ConditionalOnClass({ RefreshBusEndpoint.class, ObjectMapper.class })
62-
@AutoConfigureBefore({ BusAutoConfiguration.class, JacksonAutoConfiguration.class })
61+
@AutoConfigureBefore(value = BusAutoConfiguration.class,
62+
name = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration")
6363
public class BusJacksonAutoConfiguration {
6464

6565
// needed in the case where @RemoteApplicationEventScan is not used

spring-cloud-bus/src/test/java/org/springframework/cloud/bus/RefreshListenerIntegrationTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2020 the original author or authors.
2+
* Copyright 2013-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,11 +24,11 @@
2424
import org.springframework.beans.factory.annotation.Autowired;
2525
import org.springframework.boot.autoconfigure.SpringBootApplication;
2626
import org.springframework.boot.test.context.SpringBootTest;
27-
import org.springframework.boot.test.mock.mockito.MockBean;
28-
import org.springframework.boot.test.web.client.TestRestTemplate;
27+
import org.springframework.boot.web.server.test.client.TestRestTemplate;
2928
import org.springframework.cloud.stream.binder.test.TestChannelBinderConfiguration;
3029
import org.springframework.context.annotation.Import;
3130
import org.springframework.http.HttpStatus;
31+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
3232
import org.springframework.test.context.junit4.SpringRunner;
3333

3434
import static org.assertj.core.api.Assertions.assertThat;
@@ -48,7 +48,7 @@ public class RefreshListenerIntegrationTests {
4848
@Autowired
4949
private TestRestTemplate rest;
5050

51-
@MockBean
51+
@MockitoBean
5252
private BusBridge busBridge;
5353

5454
@Test

0 commit comments

Comments
 (0)