Skip to content

Commit 8e1a71c

Browse files
Implemeneted new post handle test
1 parent 5a5c186 commit 8e1a71c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright 2013-2020 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.cloud.sleuth.otel.instrument.web;
18+
19+
import io.opentelemetry.sdk.trace.samplers.Sampler;
20+
21+
import org.springframework.boot.test.context.SpringBootTest;
22+
import org.springframework.cloud.sleuth.otel.OtelTestSpanHandler;
23+
import org.springframework.cloud.sleuth.otel.bridge.ArrayListSpanProcessor;
24+
import org.springframework.context.annotation.Bean;
25+
import org.springframework.context.annotation.Configuration;
26+
import org.springframework.test.context.ContextConfiguration;
27+
28+
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
29+
@ContextConfiguration(classes = TraceCustomHandlerParserPostHandleWebIntegrationTests.Config.class)
30+
public class TraceCustomHandlerParserPostHandleWebIntegrationTests extends org.springframework.cloud.sleuth.instrument.web.TraceCustomHandlerParserPostHandleWebIntegrationTests {
31+
32+
@Configuration(proxyBeanMethods = false)
33+
static class Config {
34+
35+
@Bean
36+
OtelTestSpanHandler testSpanHandlerSupplier() {
37+
return new OtelTestSpanHandler(new ArrayListSpanProcessor());
38+
}
39+
40+
@Bean
41+
Sampler alwaysSampler() {
42+
return Sampler.alwaysOn();
43+
}
44+
45+
}
46+
47+
}

0 commit comments

Comments
 (0)