Skip to content

Commit

Permalink
*add springboot3 it
Browse files Browse the repository at this point in the history
Signed-off-by: provenceee <[email protected]>
  • Loading branch information
provenceee committed Nov 15, 2024
1 parent c4ba949 commit bcb18a4
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 61 deletions.
17 changes: 15 additions & 2 deletions .github/actions/common/spring/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,24 @@ runs:
key: ${{ runner.os }}-agent-${{ github.run_id }}
- name: plugin change check
uses: ./.github/actions/common/plugin-change-check
- name: change feign version
shell: bash
if: matrix.springCloudVersion != '2022.0.0' && matrix.springCloudVersion != '2022.0.1' && matrix.springCloudVersion != '2022.0.2'
run: |
sed -i 's/org.apache.httpcomponents/org.apache.httpcomponents.client5/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/pom.xml
sed -i 's/httpclient/httpclient5/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/pom.xml
sed -i 's/org.apache.http.conn/org.apache.hc.client5.http/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration/FeignClientSslConfigurationHighVersion.java.highVersion
- name: change file version
# For build feign client ssl call config, according to springCloud version discriminate high and low config.
if: matrix.springCloudVersion == '2020.0.0' || matrix.springCloudVersion == '2021.0.0' || matrix.springCloudVersion == '2021.0.3'
shell: bash
run: |
mv sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration/FeignClientSslConfigurationLowVersion.java sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration/FeignClientSslConfigurationLowVersion.java.lowVersion
mv sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration/FeignClientSslConfigurationHighVersion.java.highVersion sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration/FeignClientSslConfigurationHighVersion.java
ls sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration
ls sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/configuration
sed -i 's/qualifier/qualifiers/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/FeignService.java
sed -i 's/qualifier/qualifiers/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-api/src/main/java/com/huaweicloud/spring/feign/api/RemovalService.java
sed -i 's/javax.servlet.http/jakarta.servlet.http/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign/feign-provider/src/main/java/com/huaweicloud/spring/feign/provider/FeignServiceImpl.java
sed -i 's/javax.servlet.http/jakarta.servlet.http/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/src/main/java/com/huaweicloud/spring/rest/provider/RouterController.java
sed -i 's/javax.annotation/jakarta.annotation/' sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/src/main/java/com/huaweicloud/spring/rest/consumer/BootRegistryHttpClientController.java
mv sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/src/main/java/com/huaweicloud/spring/rest/consumer/FlowcontrolConiguration.java sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/src/main/java/com/huaweicloud/spring/rest/consumer/FlowcontrolConiguration.java.spring
mv sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/src/main/java/com/huaweicloud/spring/rest/consumer/FlowcontrolConiguration.java.springboot3 sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/src/main/java/com/huaweicloud/spring/rest/consumer/FlowcontrolConiguration.java
20 changes: 10 additions & 10 deletions .github/actions/scenarios/spring/router/spring-router/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
SERVICE_META_PARAMETERS: Test-Env:env-001
SERVER_PORT: 8013
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider.log 2>&1 &
- name: start second feign provider service
shell: bash
Expand All @@ -52,7 +52,7 @@ runs:
SERVICE_META_PARAMETERS: Test-Env:env-002
SERVER_PORT: 8014
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider2.log 2>&1 &
- name: start third feign provider service
shell: bash
Expand All @@ -66,7 +66,7 @@ runs:
SERVICE_META_PARAMETERS: Test-Env1:env-002
SERVER_PORT: 8015
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider3.log 2>&1 &
- name: start fourth feign provider service
shell: bash
Expand All @@ -79,7 +79,7 @@ runs:
ROUTER_PLUGIN_REQUEST_TAGS: "[Test-Env,Test-Env1]"
SERVER_PORT: 8016
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-provider${{ env.tailVersion }}/target/feign-provider${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-provider4.log 2>&1 &
- name: start feign consumer service
shell: bash
Expand All @@ -93,7 +93,7 @@ runs:
SERVER_PORT: 8017
SERMANT_SPRINGBOOT_REGISTRY_LB_MAXRETRY: 0
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-feign${{ env.tailVersion }}/feign-consumer${{ env.tailVersion }}/target/feign-consumer${{ env.tailVersion }}.jar > ${{ env.logDir }}/feign-consumer.log 2>&1 &
- name: start resttemplate provider service
shell: bash
Expand All @@ -107,7 +107,7 @@ runs:
SERVICE_META_PARAMETERS: Test-Env:env-001
SERVER_PORT: 8018
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider.log 2>&1 &
- name: start second resttemplate provider service
shell: bash
Expand All @@ -121,7 +121,7 @@ runs:
SERVICE_META_PARAMETERS: Test-Env:env-002
SERVER_PORT: 8019
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider2.log 2>&1 &
- name: start third resttemplate provider service
shell: bash
Expand All @@ -135,7 +135,7 @@ runs:
SERVICE_META_PARAMETERS: Test-Env1:env-002
SERVER_PORT: 8020
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider3.log 2>&1 &
- name: start fourth resttemplate provider service
shell: bash
Expand All @@ -148,7 +148,7 @@ runs:
ROUTER_PLUGIN_REQUEST_TAGS: "[Test-Env,Test-Env1]"
SERVER_PORT: 8021
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-provider/target/rest-provider.jar > ${{ env.logDir }}/rest-provider4.log 2>&1 &
- name: start resttemplate consumer service
shell: bash
Expand All @@ -162,7 +162,7 @@ runs:
SERVER_PORT: 8022
SERMANT_SPRINGBOOT_REGISTRY_LB_MAXRETRY: 0
run: |
nohup java -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
nohup java -Dnet.bytebuddy.experimental=true --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.math=ALL-UNNAMED --add-opens java.base/sun.net.www=ALL-UNNAMED --add-opens java.base/sun.net.www.protocol.http=ALL-UNNAMED -javaagent:sermant-agent-${{ env.sermantVersion }}/agent/sermant-agent.jar=appName=default -jar \
sermant-integration-tests/spring-test/spring-common-demos/spring-common-resttemplate/rest-consumer/target/rest-consumer.jar > ${{ env.logDir }}/rest-consumer.log 2>&1 &
- name: waiting for services start
shell: bash
Expand Down
47 changes: 23 additions & 24 deletions .github/workflows/spring_integration_test_2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,35 +87,34 @@ jobs:
strategy:
matrix:
include:
- springBootVersion: "1.5.0.RELEASE"
springCloudVersion: "Edgware.SR2"
nacosVersion: "1.5.0.RELEASE"
- springBootVersion: "2.0.2.RELEASE"
springCloudVersion: "Finchley.RELEASE"
- springBootVersion: "3.0.4"
springCloudVersion: "2022.0.0"
- springBootVersion: "3.0.8"
springCloudVersion: "2022.0.1"
httpClientVersion: "4.1.3"
nacosVersion: "2.0.0.RELEASE"
- springBootVersion: "2.1.0.RELEASE"
springCloudVersion: "Greenwich.RELEASE"
- springBootVersion: "3.0.12"
springCloudVersion: "2022.0.2"
httpClientVersion: "4.2.6"
nacosVersion: "2.1.0.RELEASE"
- springBootVersion: "2.2.0.RELEASE"
springCloudVersion: "Hoxton.RELEASE"
- springBootVersion: "3.1.4"
springCloudVersion: "2022.0.3"
httpClientVersion: "4.3.6"
nacosVersion: "2.2.0.RELEASE"
- springBootVersion: "2.3.0.RELEASE"
springCloudVersion: "Hoxton.RELEASE"
- springBootVersion: "3.1.8"
springCloudVersion: "2022.0.4"
httpClientVersion: "4.4.1"
nacosVersion: "2.2.8.RELEASE"
- springBootVersion: "2.4.0"
springCloudVersion: "2020.0.0"
- springBootVersion: "3.1.12"
springCloudVersion: "2022.0.5"
httpClientVersion: "4.5.6"
nacosVersion: "2021.0.1.0"
- springBootVersion: "2.6.2"
springCloudVersion: "2021.0.0"
- springBootVersion: "3.2.4"
springCloudVersion: "2023.0.0"
httpClientVersion: "4.5.10"
nacosVersion: "2021.1"
- springBootVersion: "2.7.2"
springCloudVersion: "2021.0.3"
- springBootVersion: "3.2.8"
springCloudVersion: "2023.0.1"
httpClientVersion: "4.5.13"
- springBootVersion: "3.3.0"
springCloudVersion: "2023.0.2"
httpClientVersion: "4.5.13"
- springBootVersion: "3.3.5"
springCloudVersion: "2023.0.3"
httpClientVersion: "4.5.13"
fail-fast: false
steps:
Expand All @@ -124,7 +123,7 @@ jobs:
fetch-depth: 100
- name: set java version to environment
run: |
echo "javaVersion=8" >> $GITHUB_ENV
echo "javaVersion=21" >> $GITHUB_ENV
- name: common operations
uses: ./.github/actions/common/spring
- name: (spring router) test for springboot=${{ matrix.springBootVersion }} springCloudVersion=${{ matrix.springCloudVersion }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.1.1</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package com.huaweicloud.spring.rest.consumer;

import com.huaweicloud.spring.common.flowcontrol.handlers.RestTemplateResponseErrorHandler;

import org.apache.http.client.config.RequestConfig;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
Expand Down Expand Up @@ -63,7 +65,9 @@ public class FlowcontrolConiguration {
@LoadBalanced
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
RestTemplate restTemplate = new RestTemplate();
restTemplate.setErrorHandler(new RestTemplateResponseErrorHandler());
return restTemplate;
}

/**
Expand Down
Loading

0 comments on commit bcb18a4

Please sign in to comment.