Skip to content

Commit 43a2b1d

Browse files
authored
[#1537] Clearing the EOS service component commons-configuration (#1538) (#1539)
1 parent 7696631 commit 43a2b1d

File tree

24 files changed

+186
-69
lines changed

24 files changed

+186
-69
lines changed

integration-tests/discovery-nacos-tests/order-consumer/src/main/java/com/huaweicloud/sample/OrderController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
package com.huaweicloud.sample;
1818

19-
import org.apache.commons.lang.StringUtils;
19+
import org.apache.commons.lang3.StringUtils;
2020
import org.springframework.beans.factory.annotation.Autowired;
2121
import org.springframework.cloud.client.discovery.DiscoveryClient;
2222
import org.springframework.http.MediaType;

integration-tests/discovery-nacos-tests/price-provider/src/main/java/com/huaweicloud/sample/PriceController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import java.util.List;
2020

21-
import org.apache.commons.lang.StringUtils;
21+
import org.apache.commons.lang3.StringUtils;
2222
import org.springframework.beans.factory.annotation.Autowired;
2323
import org.springframework.web.bind.annotation.PostMapping;
2424
import org.springframework.web.bind.annotation.RequestBody;

integration-tests/discovery-servicecomb-tests/discovery-tests-client/src/test/java/com/huaweicloud/sample/GovernanceControllerIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ public void run() {
203203
}
204204

205205
@Test
206-
public void testCircuitBreakerHeader() {
206+
public void testCircuitBreakerHeader() throws InterruptedException {
207+
Thread.sleep(50000);
207208
AtomicBoolean notExpectedFailed = new AtomicBoolean(false);
208209
AtomicLong successCount = new AtomicLong(0);
209210
AtomicLong rejectedCount = new AtomicLong(0);

integration-tests/discovery-servicecomb-tests/order-consumer/src/main/java/com/huaweicloud/sample/OrderController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import java.util.Locale;
2525
import java.util.TimeZone;
2626

27-
import org.apache.commons.lang.StringUtils;
27+
import org.apache.commons.lang3.StringUtils;
2828
import org.springframework.beans.factory.annotation.Autowired;
2929
import org.springframework.cloud.client.discovery.DiscoveryClient;
3030
import org.springframework.http.MediaType;

integration-tests/discovery-servicecomb-tests/price-provider/src/main/java/com/huaweicloud/sample/PriceController.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
import java.util.Locale;
2323
import java.util.TimeZone;
2424

25-
import org.apache.commons.lang.StringUtils;
25+
import org.apache.commons.lang3.StringUtils;
2626
import org.springframework.beans.factory.annotation.Autowired;
27-
import org.springframework.format.annotation.DateTimeFormat;
2827
import org.springframework.web.bind.annotation.GetMapping;
2928
import org.springframework.web.bind.annotation.PostMapping;
3029
import org.springframework.web.bind.annotation.RequestBody;

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import spring-framework-bom. No need configure spring version. -->
4040
<spring-cloud.version>2021.0.9</spring-cloud.version>
4141
<spring-boot.version>2.7.18</spring-boot.version>
42-
<servicecomb.version>2.8.30</servicecomb.version>
42+
<servicecomb.version>2.8.31</servicecomb.version>
4343
</properties>
4444

4545
<modules>

spring-cloud-huawei-common/pom.xml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@
6868
<groupId>com.google.code.findbugs</groupId>
6969
<artifactId>annotations</artifactId>
7070
</dependency>
71-
<dependency>
72-
<groupId>commons-configuration</groupId>
73-
<artifactId>commons-configuration</artifactId>
74-
</dependency>
7571
<dependency>
7672
<groupId>org.apache.servicecomb</groupId>
7773
<artifactId>foundation-common</artifactId>
74+
<exclusions>
75+
<exclusion>
76+
<groupId>com.netflix.archaius</groupId>
77+
<artifactId>archaius-core</artifactId>
78+
</exclusion>
79+
</exclusions>
7880
</dependency>
7981
<dependency>
8082
<groupId>org.apache.servicecomb</groupId>
@@ -83,6 +85,16 @@
8385
<dependency>
8486
<groupId>org.apache.servicecomb</groupId>
8587
<artifactId>http-client-common</artifactId>
88+
<exclusions>
89+
<exclusion>
90+
<groupId>commons-configuration</groupId>
91+
<artifactId>commons-configuration</artifactId>
92+
</exclusion>
93+
<exclusion>
94+
<groupId>com.netflix.archaius</groupId>
95+
<artifactId>archaius-core</artifactId>
96+
</exclusion>
97+
</exclusions>
8698
</dependency>
8799
<dependency>
88100
<groupId>io.micrometer</groupId>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
3+
* Copyright (C) 2020-2026 Huawei Technologies Co., Ltd. All rights reserved.
4+
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package com.huaweicloud.common;
19+
20+
import org.apache.servicecomb.foundation.common.LegacyPropertyFactory;
21+
import org.springframework.boot.SpringApplication;
22+
import org.springframework.boot.env.EnvironmentPostProcessor;
23+
import org.springframework.core.env.ConfigurableEnvironment;
24+
25+
public class ConfigEnvironmentPostProcessor implements EnvironmentPostProcessor {
26+
@Override
27+
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
28+
LegacyPropertyFactory.setEnvironment(environment);
29+
}
30+
}

spring-cloud-huawei-common/src/main/java/com/huaweicloud/common/adapters/webflux/InvocationContextWebFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package com.huaweicloud.common.adapters.webflux;
1919

20-
import org.apache.commons.lang.StringUtils;
20+
import org.apache.commons.lang3.StringUtils;
2121
import org.springframework.boot.web.reactive.filter.OrderedWebFilter;
2222
import org.springframework.core.Ordered;
2323
import org.springframework.core.env.Environment;

spring-cloud-huawei-common/src/main/java/com/huaweicloud/common/adapters/webmvc/InvocationContextFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import javax.servlet.http.HttpServletRequest;
2828
import javax.servlet.http.HttpServletResponse;
2929

30-
import org.apache.commons.lang.StringUtils;
30+
import org.apache.commons.lang3.StringUtils;
3131
import org.slf4j.MDC;
3232

3333
import com.huaweicloud.common.configration.dynamic.ContextProperties;

0 commit comments

Comments
 (0)