This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 10ddf0c fix a bug that spring-mvc set an error endpoint name (#6783)
10ddf0c is described below
commit 10ddf0c373f4140be385bb6c07a1804284b8a63e
Author: Darcy <[email protected]>
AuthorDate: Thu Apr 29 07:52:35 2021 +0800
fix a bug that spring-mvc set an error endpoint name (#6783)
---
CHANGES.md | 3 +-
.../mvc/v3/ControllerConstructorInterceptor.java | 3 +-
.../mvc/v4/ControllerConstructorInterceptor.java | 3 +-
...trollerForLowVersionConstructorInterceptor.java | 3 +-
.../mvc/v5/ControllerConstructorInterceptor.java | 3 +-
.../RequestMappingMethodInterceptor.java | 6 +-
.../spring-3.0.x-scenario/config/expectedData.yaml | 176 +++++--
.../apm/testcase/spring3/CaseController.java | 1 +
.../spring3/implinterface/TestCaseController.java} | 21 +-
.../spring3}/implinterface/TestCaseInterface.java | 12 +-
.../testcase/spring3/service/TestServiceBean.java | 9 +
.../spring-3.1.x-scenario/config/expectedData.yaml | 545 ++++++++++++---------
.../implinterface/TestCaseController.java} | 19 +-
.../testcase/implinterface/TestCaseInterface.java | 10 +-
.../resttemplate/RestTemplateController.java | 9 +
.../spring-4.1.x-scenario/config/expectedData.yaml | 538 +++++++++++---------
.../implinterface/TestCaseController.java} | 19 +-
.../testcase/implinterface/TestCaseInterface.java | 7 +-
.../resttemplate/RestTemplateController.java | 9 +
.../testcase/implinterface/TestCaseInterface.java | 5 +-
20 files changed, 846 insertions(+), 555 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index c3a4c6e..ddd2224 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -17,7 +17,8 @@ Release Notes.
* Add Seata in the component definition. Seata plugin hosts on Seata project.
* Extended Kafka plugin to properly trace consumers that have topic partitions
directly assigned.
* Support print SkyWalking context to logs.
-* Add `MessageListener` enhancement in pulsar plugin
+* Add `MessageListener` enhancement in pulsar plugin.
+* fix a bug that spring-mvc set an error endpoint name if the controller class
annotation implements an interface.
* Add an optional agent plugin to support mybatis.
#### OAP-Backend
diff --git
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v3/ControllerConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v3/ControllerConstructorInterceptor.java
index 1df6f58..5fa4f0a 100644
---
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v3/ControllerConstructorInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v3/ControllerConstructorInterceptor.java
@@ -22,6 +22,7 @@ import
org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedInstance;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import
org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
+import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping;
/**
@@ -32,7 +33,7 @@ public class ControllerConstructorInterceptor implements
InstanceConstructorInte
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = "";
- RequestMapping basePathRequestMapping =
objInst.getClass().getAnnotation(RequestMapping.class);
+ RequestMapping basePathRequestMapping =
AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
diff --git
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerConstructorInterceptor.java
index 2930c55..1e540fa 100644
---
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerConstructorInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerConstructorInterceptor.java
@@ -22,6 +22,7 @@ import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import
org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping;
/**
@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements
InstanceConstructorInte
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = "";
- RequestMapping basePathRequestMapping =
objInst.getClass().getAnnotation(RequestMapping.class);
+ RequestMapping basePathRequestMapping =
AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
diff --git
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerForLowVersionConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerForLowVersionConstructorInterceptor.java
index 9bcbc6c..6a5c19b 100644
---
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerForLowVersionConstructorInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v4/ControllerForLowVersionConstructorInterceptor.java
@@ -22,13 +22,14 @@ import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
import
org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
+import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping;
public class ControllerForLowVersionConstructorInterceptor implements
InstanceConstructorInterceptor {
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = "";
- RequestMapping basePathRequestMapping =
objInst.getClass().getAnnotation(RequestMapping.class);
+ RequestMapping basePathRequestMapping =
AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
diff --git
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/ControllerConstructorInterceptor.java
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/ControllerConstructorInterceptor.java
index 422c39b..fb48be6 100644
---
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/ControllerConstructorInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/v5/ControllerConstructorInterceptor.java
@@ -22,6 +22,7 @@ import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.EnhancedI
import
org.apache.skywalking.apm.plugin.spring.mvc.commons.EnhanceRequireObjectCache;
import org.apache.skywalking.apm.plugin.spring.mvc.commons.PathMappingCache;
import
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceConstructorInterceptor;
+import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.web.bind.annotation.RequestMapping;
/**
@@ -42,7 +43,7 @@ public class ControllerConstructorInterceptor implements
InstanceConstructorInte
@Override
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
String basePath = "";
- RequestMapping basePathRequestMapping =
objInst.getClass().getAnnotation(RequestMapping.class);
+ RequestMapping basePathRequestMapping =
AnnotationUtils.findAnnotation(objInst.getClass(), RequestMapping.class);
if (basePathRequestMapping != null) {
if (basePathRequestMapping.value().length > 0) {
basePath = basePathRequestMapping.value()[0];
diff --git
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
index f833440..2bf651d 100644
---
a/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
+++
b/apm-sniffer/apm-sdk-plugin/spring-plugins/mvc-annotation-commons/src/main/java/org/apache/skywalking/apm/plugin/spring/mvc/commons/interceptor/RequestMappingMethodInterceptor.java
@@ -35,11 +35,7 @@ public class RequestMappingMethodInterceptor extends
AbstractMethodInterceptor {
String requestURL = null;
RequestMapping methodRequestMapping =
AnnotationUtils.getAnnotation(m, RequestMapping.class);
if (methodRequestMapping != null) {
- if (methodRequestMapping.value().length > 0) {
- requestURL = methodRequestMapping.value()[0];
- } else if (methodRequestMapping.path().length > 0) {
- requestURL = methodRequestMapping.path()[0];
- }
+ requestURL = methodRequestMapping.value().length > 0 ?
methodRequestMapping.value()[0] : "";
}
return requestURL;
});
diff --git
a/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml
index 53c13d0..840f2ba 100644
--- a/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml
+++ b/test/plugin/scenarios/spring-3.0.x-scenario/config/expectedData.yaml
@@ -14,52 +14,130 @@
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems:
-- serviceName: spring-3.0.x-scenario
- segmentSize: ge 2
- segments:
- - segmentId: not null
- spans:
- - operationName: /healthCheck
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/healthCheck'}
- - {key: http.method, value: HEAD}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
- operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
- operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
- operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - operationName: /case/spring3
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/case/spring3'}
- - {key: http.method, value: GET}
- skipAnalysis: 'false'
+ - serviceName: spring-3.0.x-scenario
+ segmentSize: ge 4
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: /healthCheck
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/healthCheck'}
+ - {key: http.method, value: HEAD}
+ - segmentId: not null
+ spans:
+ - operationName: /impl/requestmapping
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/impl/requestmapping'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/spring3, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 5, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.0.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{GET}/impl/restmapping'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/impl/restmapping'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/spring3, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 6, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.0.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
+ operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
+ operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
+ operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - operationName: /spring-3.0.x-scenario/impl/requestmapping
+ operationId: 0
+ parentSpanId: 4
+ spanId: 5
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/impl/requestmapping'}
+ - {key: http.method, value: GET}
+ - operationName: /spring-3.0.x-scenario/impl/restmapping
+ operationId: 0
+ parentSpanId: 4
+ spanId: 6
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/impl/restmapping'}
+ - {key: http.method, value: GET}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doInvokeImplCase,
+ operationId: 0, parentSpanId: 0, spanId: 4, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - operationName: /case/spring3
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.0.x-scenario/case/spring3'}
+ - {key: http.method, value: GET}
diff --git
a/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/CaseController.java
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/CaseController.java
index 487bff7..370ed73 100644
---
a/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/CaseController.java
+++
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/CaseController.java
@@ -36,6 +36,7 @@ public class CaseController {
@ResponseBody
public String updateUser() {
testServiceBean.doSomeBusiness("test");
+ testServiceBean.doInvokeImplCase();
return SUCCESS;
}
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseController.java
similarity index 64%
copy from
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
copy to
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseController.java
index cdafc05..406e7fc 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseController.java
@@ -16,15 +16,20 @@
*
*/
-package test.apache.skywalking.apm.testcase.implinterface;
+package test.apache.skywalking.apm.testcase.spring3.implinterface;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.stereotype.Controller;
-public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
- String implRequestMappingAnnotationTestCase();
+@Controller
+public class TestCaseController implements TestCaseInterface {
- @GetMapping("/impl/restmapping")
- String implRestAnnotationTestCase();
+ @Override
+ public String implRequestMappingAnnotationTestCase() {
+ return "implRequestMappingAnnotationTestCase";
+ }
+
+ @Override
+ public String implRestAnnotationTestCase() {
+ return "implRestAnnotationTestCase";
+ }
}
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseInterface.java
similarity index 73%
copy from
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
copy to
test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseInterface.java
index cdafc05..f63eb15 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/implinterface/TestCaseInterface.java
@@ -16,15 +16,19 @@
*
*/
-package test.apache.skywalking.apm.testcase.implinterface;
+package test.apache.skywalking.apm.testcase.spring3.implinterface;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+@RequestMapping("/impl")
public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
+ @RequestMapping("/requestmapping")
+ @ResponseBody
String implRequestMappingAnnotationTestCase();
- @GetMapping("/impl/restmapping")
+ @RequestMapping(value = "/restmapping", method = RequestMethod.GET)
+ @ResponseBody
String implRestAnnotationTestCase();
}
diff --git
a/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/service/TestServiceBean.java
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/service/TestServiceBean.java
index 811fe11..323b1c2 100644
---
a/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/service/TestServiceBean.java
+++
b/test/plugin/scenarios/spring-3.0.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring3/service/TestServiceBean.java
@@ -20,11 +20,14 @@ package test.apache.skywalking.apm.testcase.spring3.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
import test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean;
import test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean;
@Service
public class TestServiceBean {
+ public static final String URL =
"http://localhost:8080/spring-3.0.x-scenario";
+
@Autowired
private TestComponentBean componentBean;
@@ -35,4 +38,10 @@ public class TestServiceBean {
componentBean.componentMethod(name);
repositoryBean.doSomeStuff(name);
}
+
+ public void doInvokeImplCase() {
+ RestTemplate restTemplate = new RestTemplate();
+ restTemplate.getForObject(URL + "/impl/requestmapping", String.class);
+ restTemplate.getForObject(URL + "/impl/restmapping", String.class);
+ }
}
diff --git
a/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml
index b6d866d..130ba56 100644
--- a/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml
+++ b/test/plugin/scenarios/spring-3.1.x-scenario/config/expectedData.yaml
@@ -14,236 +14,315 @@
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems:
-- serviceName: spring-3.1.x-scenario
- segmentSize: ge 7
- segments:
- - segmentId: not null
- spans:
- - operationName: /healthCheck
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/healthCheck'}
- - {key: http.method, value: HEAD}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
- operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
- operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
- operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - operationName: /case/spring3
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'}
- - {key: http.method, value: GET}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-3.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{POST}/create/'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/create/'}
- - {key: http.method, value: POST}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 2, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-3.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{GET}/get/{id}'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/get/1'}
- - {key: http.method, value: GET}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 3, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-3.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{DELETE}/delete/{id}'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/delete/1'}
- - {key: http.method, value: DELETE}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 5, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-3.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: /spring-3.1.x-scenario/case/spring3/
- operationId: 0
- parentSpanId: 0
- spanId: 1
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 12
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: http.method, value: GET}
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'}
- skipAnalysis: 'false'
- - operationName: /spring-3.1.x-scenario/create/
- operationId: 0
- parentSpanId: 0
- spanId: 2
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/create/'}
- - {key: http.method, value: POST}
- skipAnalysis: 'false'
- - operationName: /spring-3.1.x-scenario/get/1
- operationId: 0
- parentSpanId: 0
- spanId: 3
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value: 'http://localhost:8080/spring-3.1.x-scenario/get/1'}
- - {key: http.method, value: GET}
- skipAnalysis: 'false'
- - operationName: /spring-3.1.x-scenario/update/1
- operationId: 0
- parentSpanId: 0
- spanId: 4
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/update/1'}
- - {key: http.method, value: PUT}
- skipAnalysis: 'false'
- - operationName: /spring-3.1.x-scenario/delete/1
- operationId: 0
- parentSpanId: 0
- spanId: 5
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/delete/1'}
- - {key: http.method, value: DELETE}
- skipAnalysis: 'false'
- - operationName: /case/resttemplate
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/case/resttemplate'}
- - {key: http.method, value: GET}
- - key: http.params
- value: |-
- q1=[v1]
- chinese=[中文]
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{PUT}/update/{id}'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/update/1'}
- - {key: http.method, value: PUT}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 4, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-3.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
+ - serviceName: spring-3.1.x-scenario
+ segmentSize: ge 9
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: /healthCheck
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/healthCheck'}
+ - {key: http.method, value: HEAD}
+ - segmentId: not null
+ spans:
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
+ operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
+ operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
+ operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - operationName: /case/spring3
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 1, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{POST}/create/'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/create/'}
+ - {key: http.method, value: POST}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 2, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{GET}/get/{id}'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/get/1'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 3, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{DELETE}/delete/{id}'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/delete/1'}
+ - {key: http.method, value: DELETE}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 5, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{PUT}/update/{id}'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/update/1'}
+ - {key: http.method, value: PUT}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 4, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: /impl/requestmapping
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/impl/requestmapping'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 6, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: /spring-3.1.x-scenario/case/spring3/
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 12
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/case/spring3/'}
+ - operationName: /spring-3.1.x-scenario/create/
+ operationId: 0
+ parentSpanId: 0
+ spanId: 2
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/create/'}
+ - {key: http.method, value: POST}
+ - operationName: /spring-3.1.x-scenario/get/1
+ operationId: 0
+ parentSpanId: 0
+ spanId: 3
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/get/1'}
+ - {key: http.method, value: GET}
+ - operationName: /spring-3.1.x-scenario/update/1
+ operationId: 0
+ parentSpanId: 0
+ spanId: 4
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/update/1'}
+ - {key: http.method, value: PUT}
+ - operationName: /spring-3.1.x-scenario/delete/1
+ operationId: 0
+ parentSpanId: 0
+ spanId: 5
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/delete/1'}
+ - {key: http.method, value: DELETE}
+ - operationName: /spring-3.1.x-scenario/impl/requestmapping
+ operationId: 0
+ parentSpanId: 0
+ spanId: 6
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 12
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/impl/requestmapping'}
+ - operationName: /spring-3.1.x-scenario/impl/restmapping
+ operationId: 0
+ parentSpanId: 0
+ spanId: 7
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 12
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/impl/restmapping'}
+ - operationName: /case/resttemplate
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/case/resttemplate'}
+ - {key: http.method, value: GET}
+ - key: http.params
+ value: |-
+ q1=[v1]
+ chinese=[中文]
+ - segmentId: not null
+ spans:
+ - operationName: '{GET}/impl/restmapping'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-3.1.x-scenario/impl/restmapping'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 7, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-3.1.x-scenario,
+ traceId: not null}
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
similarity index 69%
copy from
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
copy to
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
index cdafc05..4688ee5 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
@@ -18,13 +18,18 @@
package test.apache.skywalking.apm.testcase.implinterface;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.stereotype.Controller;
-public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
- String implRequestMappingAnnotationTestCase();
+@Controller
+public class TestCaseController implements TestCaseInterface {
- @GetMapping("/impl/restmapping")
- String implRestAnnotationTestCase();
+ @Override
+ public String implRequestMappingAnnotationTestCase() {
+ return "implRequestMappingAnnotationTestCase";
+ }
+
+ @Override
+ public String implRestAnnotationTestCase() {
+ return "implRestAnnotationTestCase";
+ }
}
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
similarity index 78%
copy from
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
copy to
test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
index cdafc05..eef5e42 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
@@ -18,13 +18,17 @@
package test.apache.skywalking.apm.testcase.implinterface;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+@RequestMapping("/impl")
public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
+ @RequestMapping("/requestmapping")
+ @ResponseBody
String implRequestMappingAnnotationTestCase();
- @GetMapping("/impl/restmapping")
+ @RequestMapping(value = "/restmapping", method = RequestMethod.GET)
+ @ResponseBody
String implRestAnnotationTestCase();
}
diff --git
a/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
b/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
index d1e32ad..7c82bc8 100644
---
a/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
+++
b/test/plugin/scenarios/spring-3.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
@@ -19,6 +19,7 @@
package test.apache.skywalking.apm.testcase.resttemplate;
import java.io.IOException;
+
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
@@ -61,6 +62,14 @@ public class RestTemplateController {
//Delete user
new RestTemplate().delete(URL + "/delete/{id}", 1);
+ Request implRequestMappingRequest = new Request.Builder().url(URL +
"/impl/requestmapping").build();
+ response = new
OkHttpClient().newCall(implRequestMappingRequest).execute();
+ LOGGER.info(response.toString());
+
+ Request implRestMappingRequest = new Request.Builder().url(URL +
"/impl/restmapping").build();
+ response = new
OkHttpClient().newCall(implRestMappingRequest).execute();
+ LOGGER.info(response.toString());
+
return SUCCESS;
}
diff --git
a/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml
b/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml
index b4314fb..67f99ed 100644
--- a/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml
+++ b/test/plugin/scenarios/spring-4.1.x-scenario/config/expectedData.yaml
@@ -14,232 +14,312 @@
# See the License for the specific language governing permissions and
# limitations under the License.
segmentItems:
-- serviceName: spring-4.1.x-scenario
- segmentSize: ge 7
- segments:
- - segmentId: not null
- spans:
- - operationName: /healthCheck
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/healthCheck'}
- - {key: http.method, value: HEAD}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
- operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
- operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
- operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown,
startTime: nq
- 0, endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
- skipAnalysis: 'false'}
- - operationName: /case/spring3
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'}
- - {key: http.method, value: GET}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 1, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-4.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{POST}/create/'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/create/'}
- - {key: http.method, value: POST}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 2, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-4.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{GET}/get/{id}'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/get/1'}
- - {key: http.method, value: GET}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 3, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-4.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{DELETE}/delete/{id}'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/delete/1'}
- - {key: http.method, value: DELETE}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 5, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-4.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: /spring-4.1.x-scenario/case/spring3/
- operationId: 0
- parentSpanId: 0
- spanId: 1
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 12
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: http.method, value: GET}
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'}
- skipAnalysis: 'false'
- - operationName: /spring-4.1.x-scenario/create/
- operationId: 0
- parentSpanId: 0
- spanId: 2
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/create/'}
- - {key: http.method, value: POST}
- skipAnalysis: 'false'
- - operationName: /spring-4.1.x-scenario/get/1
- operationId: 0
- parentSpanId: 0
- spanId: 3
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value: 'http://localhost:8080/spring-4.1.x-scenario/get/1'}
- - {key: http.method, value: GET}
- skipAnalysis: 'false'
- - operationName: /spring-4.1.x-scenario/update/1
- operationId: 0
- parentSpanId: 0
- spanId: 4
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/update/1'}
- - {key: http.method, value: PUT}
- skipAnalysis: 'false'
- - operationName: /spring-4.1.x-scenario/delete/1
- operationId: 0
- parentSpanId: 0
- spanId: 5
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 13
- isError: false
- spanType: Exit
- peer: localhost:8080
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/delete/1'}
- - {key: http.method, value: DELETE}
- skipAnalysis: 'false'
- - operationName: /case/resttemplate
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/case/resttemplate'}
- - {key: http.method, value: GET}
- skipAnalysis: 'false'
- - segmentId: not null
- spans:
- - operationName: '{PUT}/update/{id}'
- operationId: 0
- parentSpanId: -1
- spanId: 0
- spanLayer: Http
- startTime: nq 0
- endTime: nq 0
- componentId: 14
- isError: false
- spanType: Entry
- peer: ''
- tags:
- - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/update/1'}
- - {key: http.method, value: PUT}
- refs:
- - {parentEndpoint: /case/resttemplate, networkAddress: 'localhost:8080',
refType: CrossProcess,
- parentSpanId: 4, parentTraceSegmentId: not null,
parentServiceInstance: not
- null, parentService: spring-4.1.x-scenario, traceId: not null}
- skipAnalysis: 'false'
+ - serviceName: spring-4.1.x-scenario
+ segmentSize: ge 9
+ segments:
+ - segmentId: not null
+ spans:
+ - operationName: /healthCheck
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/healthCheck'}
+ - {key: http.method, value: HEAD}
+ - segmentId: not null
+ spans:
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.component.TestComponentBean.componentMethod,
+ operationId: 0, parentSpanId: 1, spanId: 2, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.dao.TestRepositoryBean.doSomeStuff,
+ operationId: 0, parentSpanId: 1, spanId: 3, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - {operationName:
test.apache.skywalking.apm.testcase.spring3.service.TestServiceBean.doSomeBusiness,
+ operationId: 0, parentSpanId: 0, spanId: 1, spanLayer: Unknown,
startTime: nq 0,
+ endTime: nq 0, componentId: 93, isError: false, spanType: Local,
peer: '',
+ skipAnalysis: false}
+ - operationName: /case/spring3
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 1, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{POST}/create/'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/create/'}
+ - {key: http.method, value: POST}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 2, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{GET}/get/{id}'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/get/1'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 3, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{PUT}/update/{id}'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/update/1'}
+ - {key: http.method, value: PUT}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 4, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: '{DELETE}/delete/{id}'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/delete/1'}
+ - {key: http.method, value: DELETE}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 5, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: /impl/requestmapping
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/impl/requestmapping'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 6, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+ - segmentId: not null
+ spans:
+ - operationName: /spring-4.1.x-scenario/case/spring3/
+ operationId: 0
+ parentSpanId: 0
+ spanId: 1
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 12
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/case/spring3/'}
+ - operationName: /spring-4.1.x-scenario/create/
+ operationId: 0
+ parentSpanId: 0
+ spanId: 2
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/create/'}
+ - {key: http.method, value: POST}
+ - operationName: /spring-4.1.x-scenario/get/1
+ operationId: 0
+ parentSpanId: 0
+ spanId: 3
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/get/1'}
+ - {key: http.method, value: GET}
+ - operationName: /spring-4.1.x-scenario/update/1
+ operationId: 0
+ parentSpanId: 0
+ spanId: 4
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/update/1'}
+ - {key: http.method, value: PUT}
+ - operationName: /spring-4.1.x-scenario/delete/1
+ operationId: 0
+ parentSpanId: 0
+ spanId: 5
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 13
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/delete/1'}
+ - {key: http.method, value: DELETE}
+ - operationName: /spring-4.1.x-scenario/impl/requestmapping
+ operationId: 0
+ parentSpanId: 0
+ spanId: 6
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 12
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/impl/requestmapping'}
+ - operationName: /spring-4.1.x-scenario/impl/restmapping
+ operationId: 0
+ parentSpanId: 0
+ spanId: 7
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 12
+ isError: false
+ spanType: Exit
+ peer: localhost:8080
+ skipAnalysis: false
+ tags:
+ - {key: http.method, value: GET}
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/impl/restmapping'}
+ - operationName: /case/resttemplate
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/case/resttemplate'}
+ - {key: http.method, value: GET}
+ - segmentId: not null
+ spans:
+ - operationName: '{GET}/impl/restmapping'
+ operationId: 0
+ parentSpanId: -1
+ spanId: 0
+ spanLayer: Http
+ startTime: nq 0
+ endTime: nq 0
+ componentId: 14
+ isError: false
+ spanType: Entry
+ peer: ''
+ skipAnalysis: false
+ tags:
+ - {key: url, value:
'http://localhost:8080/spring-4.1.x-scenario/impl/restmapping'}
+ - {key: http.method, value: GET}
+ refs:
+ - {parentEndpoint: /case/resttemplate, networkAddress:
'localhost:8080', refType: CrossProcess,
+ parentSpanId: 7, parentTraceSegmentId: not null,
+ parentServiceInstance: not null, parentService:
spring-4.1.x-scenario,
+ traceId: not null}
+
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
similarity index 68%
copy from
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
copy to
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
index cdafc05..7a95a93 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseController.java
@@ -18,13 +18,18 @@
package test.apache.skywalking.apm.testcase.implinterface;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
-public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
- String implRequestMappingAnnotationTestCase();
+@RestController
+public class TestCaseController implements TestCaseInterface {
- @GetMapping("/impl/restmapping")
- String implRestAnnotationTestCase();
+ @Override
+ public String implRequestMappingAnnotationTestCase() {
+ return "implRequestMappingAnnotationTestCase";
+ }
+
+ @Override
+ public String implRestAnnotationTestCase() {
+ return "implRestAnnotationTestCase";
+ }
}
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
similarity index 84%
copy from
test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
copy to
test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
index cdafc05..b2af584 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
@@ -18,13 +18,14 @@
package test.apache.skywalking.apm.testcase.implinterface;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+@RequestMapping("/impl")
public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
+ @RequestMapping("/requestmapping")
String implRequestMappingAnnotationTestCase();
- @GetMapping("/impl/restmapping")
+ @RequestMapping(value = "/restmapping", method = RequestMethod.GET)
String implRestAnnotationTestCase();
}
diff --git
a/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
b/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
index 0178598..4695ada 100644
---
a/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
+++
b/test/plugin/scenarios/spring-4.1.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/resttemplate/RestTemplateController.java
@@ -19,6 +19,7 @@
package test.apache.skywalking.apm.testcase.resttemplate;
import java.io.IOException;
+
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
@@ -61,6 +62,14 @@ public class RestTemplateController {
//Delete user
new RestTemplate().delete(URL + "/delete/{id}", 1);
+ Request implRequestMappingRequest = new Request.Builder().url(URL +
"/impl/requestmapping").build();
+ response = new
OkHttpClient().newCall(implRequestMappingRequest).execute();
+ LOGGER.info(response.toString());
+
+ Request implRestMappingRequest = new Request.Builder().url(URL +
"/impl/restmapping").build();
+ response = new
OkHttpClient().newCall(implRestMappingRequest).execute();
+ LOGGER.info(response.toString());
+
return SUCCESS;
}
diff --git
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
b/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
index cdafc05..4fea97b 100644
---
a/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
+++
b/test/plugin/scenarios/spring-4.3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/implinterface/TestCaseInterface.java
@@ -21,10 +21,11 @@ package test.apache.skywalking.apm.testcase.implinterface;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+@RequestMapping("/impl")
public interface TestCaseInterface {
- @RequestMapping("/impl/requestmapping")
+ @RequestMapping(path = "/requestmapping")
String implRequestMappingAnnotationTestCase();
- @GetMapping("/impl/restmapping")
+ @GetMapping("/restmapping")
String implRestAnnotationTestCase();
}