Skip to content

Commit 21dfbef

Browse files
committed
Fix spring-kafka-3.x-scenario: update service name, URLs, and context path references
- Replace hardcoded spring-kafka-2.3.x-scenario URL in CaseController.java - Update serviceName, parentService refs, and operation name paths in expectedData.yaml - Fix operation names to include context path prefix (Spring Boot 3.x behavior)
1 parent b9a8434 commit 21dfbef

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

test/plugin/scenarios/spring-kafka-3.x-scenario/config/expectedData.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
segmentItems:
17-
- serviceName: spring-kafka-2.3.x-scenario
17+
- serviceName: spring-kafka-3.x-scenario
1818
segmentSize: nq 0
1919
segments:
2020
- segmentId: not null
@@ -47,7 +47,7 @@ segmentItems:
4747
tags:
4848
- { key: mq.broker, value: 'kafka-server:9092' }
4949
- { key: mq.topic, value: spring_test }
50-
- operationName: GET:/case/spring-kafka-case
50+
- operationName: GET:/spring-kafka-3.x-scenario/case/spring-kafka-case
5151
parentSpanId: -1
5252
spanId: 0
5353
spanLayer: Http
@@ -59,12 +59,12 @@ segmentItems:
5959
peer: ''
6060
skipAnalysis: false
6161
tags:
62-
- {key: url, value: 'http://localhost:8080/spring-kafka-2.3.x-scenario/case/spring-kafka-case'}
62+
- {key: url, value: 'http://localhost:8080/spring-kafka-3.x-scenario/case/spring-kafka-case'}
6363
- {key: http.method, value: GET}
6464
- {key: http.status_code, value: '200'}
6565
- segmentId: not null
6666
spans:
67-
- operationName: GET:/case/spring-kafka-consumer-ping
67+
- operationName: GET:/spring-kafka-3.x-scenario/case/spring-kafka-consumer-ping
6868
parentSpanId: -1
6969
spanId: 0
7070
spanLayer: Http
@@ -76,17 +76,17 @@ segmentItems:
7676
peer: ''
7777
skipAnalysis: false
7878
tags:
79-
- {key: url, value: 'http://localhost:8080/spring-kafka-2.3.x-scenario/case/spring-kafka-consumer-ping'}
79+
- {key: url, value: 'http://localhost:8080/spring-kafka-3.x-scenario/case/spring-kafka-consumer-ping'}
8080
- {key: http.method, value: GET}
8181
- {key: http.status_code, value: '200'}
8282
refs:
8383
- {parentEndpoint: 'Kafka/spring_test/Consumer/grop:spring_test', networkAddress: 'localhost:8080',
8484
refType: CrossProcess, parentSpanId: 1, parentTraceSegmentId: not null,
85-
parentServiceInstance: not null, parentService: spring-kafka-2.3.x-scenario,
85+
parentServiceInstance: not null, parentService: spring-kafka-3.x-scenario,
8686
traceId: not null}
8787
- segmentId: not null
8888
spans:
89-
- operationName: /spring-kafka-2.3.x-scenario/case/spring-kafka-consumer-ping
89+
- operationName: /spring-kafka-3.x-scenario/case/spring-kafka-consumer-ping
9090
parentSpanId: 0
9191
spanId: 1
9292
spanLayer: Http
@@ -99,7 +99,7 @@ segmentItems:
9999
skipAnalysis: false
100100
tags:
101101
- {key: http.method, value: GET}
102-
- {key: url, value: 'http://localhost:8080/spring-kafka-2.3.x-scenario/case/spring-kafka-consumer-ping'}
102+
- {key: url, value: 'http://localhost:8080/spring-kafka-3.x-scenario/case/spring-kafka-consumer-ping'}
103103
- {key: http.status_code, value: '200'}
104104
- operationName: Kafka/spring_test/Consumer/grop:spring_test
105105
parentSpanId: -1
@@ -119,5 +119,5 @@ segmentItems:
119119
refs:
120120
- {parentEndpoint: GET:/case/spring-kafka-case, networkAddress: 'kafka-server:9092',
121121
refType: CrossProcess, parentSpanId: not null, parentTraceSegmentId: not null,
122-
parentServiceInstance: not null, parentService: spring-kafka-2.3.x-scenario,
122+
parentServiceInstance: not null, parentService: spring-kafka-3.x-scenario,
123123
traceId: not null}

test/plugin/scenarios/spring-kafka-3.x-scenario/src/main/java/test/apache/skywalking/apm/testcase/spring/kafka/controller/CaseController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void setUpConsumer() {
113113
public void onMessage(ConsumerRecord<String, String> data, Acknowledgment acknowledgment) {
114114
if (data.value().equals(helloWorld)) {
115115
OkHttpClient client = new OkHttpClient.Builder().build();
116-
Request request = new Request.Builder().url("http://localhost:8080/spring-kafka-2.3.x-scenario/case/spring-kafka-consumer-ping").build();
116+
Request request = new Request.Builder().url("http://localhost:8080/spring-kafka-3.x-scenario/case/spring-kafka-consumer-ping").build();
117117
Response response = null;
118118
try {
119119
response = client.newCall(request).execute();

0 commit comments

Comments
 (0)