Skip to content

Commit 4ed0308

Browse files
authored
Fix smoketest (#128)
Signed-off-by: Pavol Loffay <[email protected]>
1 parent f371958 commit 4ed0308

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

smoke-tests/src/test/java/org/hypertrace/agent/smoketest/SpringBootDisabledBodyCaptureSmokeTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ public void get() throws IOException {
7777
Assertions.assertEquals(response.body().string(), "Hi!");
7878
Assertions.assertEquals(1, countSpansByName(traces, "/greeting"));
7979
Assertions.assertEquals(1, countSpansByName(traces, "webcontroller.greeting"));
80-
Assertions.assertEquals(
81-
3,
80+
Assertions.assertTrue(
8281
getSpanStream(traces)
83-
.flatMap(span -> span.getAttributesList().stream())
84-
.filter(attribute -> attribute.getKey().equals(OTEL_LIBRARY_VERSION_ATTRIBUTE))
85-
.map(attribute -> attribute.getValue().getStringValue())
86-
.filter(value -> value.equals(currentAgentVersion))
87-
.count());
82+
.flatMap(span -> span.getAttributesList().stream())
83+
.filter(attribute -> attribute.getKey().equals(OTEL_LIBRARY_VERSION_ATTRIBUTE))
84+
.map(attribute -> attribute.getValue().getStringValue())
85+
.filter(value -> value.equals(currentAgentVersion))
86+
.count()
87+
> 0);
8888
Assertions.assertEquals(
8989
0,
9090
getSpanStream(traces)

smoke-tests/src/test/java/org/hypertrace/agent/smoketest/SpringBootSmokeTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
// key = "SMOKETEST_JAVAAGENT_PATH",
3535
// value =
3636
//
37-
// "/Users/ploffay/projects/hypertrace/opentelemetry-java-agent/javaagent/build/libs/hypertrace-agent-0.2.2-SNAPSHOT-all.jar")
37+
// "/Users/ploffay/projects/hypertrace/javaagent/javaagent/build/libs/hypertrace-agent-0.3.2-all.jar")
3838
public class SpringBootSmokeTest extends AbstractSmokeTest {
3939

4040
@Override
@@ -91,14 +91,14 @@ public void get() throws IOException {
9191
Assertions.assertEquals(response.body().string(), "Hi!");
9292
Assertions.assertEquals(1, countSpansByName(traces, "/greeting"));
9393
Assertions.assertEquals(1, countSpansByName(traces, "webcontroller.greeting"));
94-
Assertions.assertEquals(
95-
3,
94+
Assertions.assertTrue(
9695
getSpanStream(traces)
97-
.flatMap(span -> span.getAttributesList().stream())
98-
.filter(attribute -> attribute.getKey().equals(OTEL_LIBRARY_VERSION_ATTRIBUTE))
99-
.map(attribute -> attribute.getValue().getStringValue())
100-
.filter(value -> value.equals(currentAgentVersion))
101-
.count());
96+
.flatMap(span -> span.getAttributesList().stream())
97+
.filter(attribute -> attribute.getKey().equals(OTEL_LIBRARY_VERSION_ATTRIBUTE))
98+
.map(attribute -> attribute.getValue().getStringValue())
99+
.filter(value -> value.equals(currentAgentVersion))
100+
.count()
101+
> 0);
102102
Assertions.assertTrue(
103103
getSpanStream(traces)
104104
.flatMap(span -> span.getAttributesList().stream())

0 commit comments

Comments
 (0)