Skip to content

Commit 483387d

Browse files
aschugunovlaurit
andauthored
move spring-ws-2.0 tests to java (#11196)
Co-authored-by: Lauri Tulmin <[email protected]>
1 parent c370aef commit 483387d

File tree

7 files changed

+282
-262
lines changed

7 files changed

+282
-262
lines changed

instrumentation/spring/spring-ws-2.0/javaagent/src/test/groovy/test/boot/HelloEndpoint.groovy

-50
This file was deleted.

instrumentation/spring/spring-ws-2.0/javaagent/src/test/groovy/test/boot/SpringWsTest.groovy

-160
This file was deleted.

instrumentation/spring/spring-ws-2.0/javaagent/src/test/groovy/test/boot/WebServiceConfig.groovy

-46
This file was deleted.

instrumentation/spring/spring-ws-2.0/javaagent/src/test/groovy/test/boot/AppConfig.groovy instrumentation/spring/spring-ws-2.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/spring/ws/v2_0/AppConfig.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package test.boot
6+
package io.opentelemetry.javaagent.instrumentation.spring.ws.v2_0;
77

8-
import org.springframework.boot.autoconfigure.SpringBootApplication
9-
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
8+
import org.springframework.boot.autoconfigure.SpringBootApplication;
9+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
1010

1111
@SpringBootApplication
12-
class AppConfig implements WebMvcConfigurer {
13-
14-
}
12+
public class AppConfig implements WebMvcConfigurer {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.javaagent.instrumentation.spring.ws.v2_0;
7+
8+
import io.opentelemetry.test.hello_web_service.HelloRequest;
9+
import io.opentelemetry.test.hello_web_service.HelloRequestSoapAction;
10+
import io.opentelemetry.test.hello_web_service.HelloRequestWsAction;
11+
import io.opentelemetry.test.hello_web_service.HelloResponse;
12+
import org.springframework.ws.server.endpoint.annotation.Endpoint;
13+
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
14+
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
15+
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
16+
import org.springframework.ws.soap.addressing.server.annotation.Action;
17+
import org.springframework.ws.soap.server.endpoint.annotation.SoapAction;
18+
19+
@Endpoint
20+
public class HelloEndpoint {
21+
22+
private static final String NAMESPACE_URI = "http://opentelemetry.io/test/hello-web-service";
23+
24+
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "helloRequest")
25+
@ResponsePayload
26+
public HelloResponse hello(@RequestPayload HelloRequest request) throws Exception {
27+
return handleHello(request.getName());
28+
}
29+
30+
@SoapAction(value = "http://opentelemetry.io/test/hello-soap-action")
31+
@ResponsePayload
32+
public HelloResponse helloSoapAction(@RequestPayload HelloRequestSoapAction request)
33+
throws Exception {
34+
return handleHello(request.getName());
35+
}
36+
37+
@Action(value = "http://opentelemetry.io/test/hello-ws-action")
38+
@ResponsePayload
39+
public HelloResponse helloWsAction(@RequestPayload HelloRequestWsAction request)
40+
throws Exception {
41+
return handleHello(request.getName());
42+
}
43+
44+
private static HelloResponse handleHello(String name) throws Exception {
45+
if ("exception".equals(name)) {
46+
throw new Exception("hello exception");
47+
}
48+
HelloResponse response = new HelloResponse();
49+
response.setMessage("Hello " + name);
50+
return response;
51+
}
52+
}

0 commit comments

Comments
 (0)