|
7 | 7 |
|
8 | 8 | import static io.opentelemetry.api.common.AttributeKey.booleanKey; |
9 | 9 | import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.equalTo; |
10 | | -import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.satisfies; |
11 | 10 |
|
12 | 11 | import io.opencensus.trace.AttributeValue; |
13 | 12 | import io.opencensus.trace.Tracing; |
|
19 | 18 | import io.opentelemetry.instrumentation.testing.internal.AutoCleanupExtension; |
20 | 19 | import io.opentelemetry.instrumentation.testing.junit.AgentInstrumentationExtension; |
21 | 20 | import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; |
22 | | -import org.assertj.core.api.AbstractBooleanAssert; |
23 | 21 | import org.junit.jupiter.api.BeforeEach; |
24 | 22 | import org.junit.jupiter.api.Test; |
25 | 23 | import org.junit.jupiter.api.extension.RegisterExtension; |
@@ -86,26 +84,17 @@ void testInterleavedSpansOcFirst() { |
86 | 84 | span -> |
87 | 85 | span.hasName("outer-span") |
88 | 86 | .hasNoParent() |
89 | | - .hasAttributesSatisfyingExactly( |
90 | | - equalTo(booleanKey("outer"), true), |
91 | | - satisfies(booleanKey("inner"), AbstractBooleanAssert::isNull), |
92 | | - satisfies(booleanKey("middle"), AbstractBooleanAssert::isNull)), |
| 87 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("outer"), true)), |
93 | 88 | // middle span |
94 | 89 | span -> |
95 | 90 | span.hasName("mid-span") |
96 | 91 | .hasParent(trace.getSpan(0)) |
97 | | - .hasAttributesSatisfyingExactly( |
98 | | - equalTo(booleanKey("middle"), true), |
99 | | - satisfies(booleanKey("inner"), AbstractBooleanAssert::isNull), |
100 | | - satisfies(booleanKey("outer"), AbstractBooleanAssert::isNull)), |
| 92 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("middle"), true)), |
101 | 93 | // inner span |
102 | 94 | span -> |
103 | 95 | span.hasName("inner-span") |
104 | 96 | .hasParent(trace.getSpan(1)) |
105 | | - .hasAttributesSatisfyingExactly( |
106 | | - equalTo(booleanKey("inner"), true), |
107 | | - satisfies(booleanKey("middle"), AbstractBooleanAssert::isNull), |
108 | | - satisfies(booleanKey("outer"), AbstractBooleanAssert::isNull)))); |
| 97 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("inner"), true)))); |
109 | 98 | } |
110 | 99 |
|
111 | 100 | @Test |
@@ -154,26 +143,17 @@ void testInterleavedSpansOtelFirst() { |
154 | 143 | span -> |
155 | 144 | span.hasName("outer-span") |
156 | 145 | .hasNoParent() |
157 | | - .hasAttributesSatisfyingExactly( |
158 | | - equalTo(booleanKey("outer"), true), |
159 | | - satisfies(booleanKey("inner"), AbstractBooleanAssert::isNull), |
160 | | - satisfies(booleanKey("middle"), AbstractBooleanAssert::isNull)), |
| 146 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("outer"), true)), |
161 | 147 | // middle span |
162 | 148 | span -> |
163 | 149 | span.hasName("mid-span") |
164 | 150 | .hasParent(trace.getSpan(0)) |
165 | | - .hasAttributesSatisfyingExactly( |
166 | | - equalTo(booleanKey("middle"), true), |
167 | | - satisfies(booleanKey("inner"), AbstractBooleanAssert::isNull), |
168 | | - satisfies(booleanKey("outer"), AbstractBooleanAssert::isNull)), |
| 151 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("middle"), true)), |
169 | 152 | // inner span |
170 | 153 | span -> |
171 | 154 | span.hasName("inner-span") |
172 | 155 | .hasParent(trace.getSpan(1)) |
173 | | - .hasAttributesSatisfyingExactly( |
174 | | - equalTo(booleanKey("inner"), true), |
175 | | - satisfies(booleanKey("middle"), AbstractBooleanAssert::isNull), |
176 | | - satisfies(booleanKey("outer"), AbstractBooleanAssert::isNull)))); |
| 156 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("inner"), true)))); |
177 | 157 | } |
178 | 158 |
|
179 | 159 | @Test |
@@ -288,25 +268,16 @@ void testNestedOpenCensusSpans() { |
288 | 268 | span -> |
289 | 269 | span.hasName("outer-span") |
290 | 270 | .hasNoParent() |
291 | | - .hasAttributesSatisfyingExactly( |
292 | | - equalTo(booleanKey("outer"), true), |
293 | | - satisfies(booleanKey("inner"), AbstractBooleanAssert::isNull), |
294 | | - satisfies(booleanKey("middle"), AbstractBooleanAssert::isNull)), |
| 271 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("outer"), true)), |
295 | 272 | // middle span |
296 | 273 | span -> |
297 | 274 | span.hasName("mid-span") |
298 | 275 | .hasParent(trace.getSpan(0)) |
299 | | - .hasAttributesSatisfyingExactly( |
300 | | - equalTo(booleanKey("middle"), true), |
301 | | - satisfies(booleanKey("inner"), AbstractBooleanAssert::isNull), |
302 | | - satisfies(booleanKey("outer"), AbstractBooleanAssert::isNull)), |
| 276 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("middle"), true)), |
303 | 277 | // inner span |
304 | 278 | span -> |
305 | 279 | span.hasName("inner-span") |
306 | 280 | .hasParent(trace.getSpan(1)) |
307 | | - .hasAttributesSatisfyingExactly( |
308 | | - equalTo(booleanKey("inner"), true), |
309 | | - satisfies(booleanKey("middle"), AbstractBooleanAssert::isNull), |
310 | | - satisfies(booleanKey("outer"), AbstractBooleanAssert::isNull)))); |
| 281 | + .hasAttributesSatisfyingExactly(equalTo(booleanKey("inner"), true)))); |
311 | 282 | } |
312 | 283 | } |
0 commit comments