Skip to content

Commit 0fcde84

Browse files
Copilottrask
andcommitted
Fix hasParent and hasNoParent methods to use tags instead of properties
Co-authored-by: trask <[email protected]>
1 parent 2ac332e commit 0fcde84

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/DependencyAssert.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,14 @@ public DependencyAssert hasTag(String key, String value) {
5555
@CanIgnoreReturnValue
5656
public DependencyAssert hasNoParent() {
5757
isNotNull();
58-
assertThat(getDependencyData().getProperties().get("ai.operation.parentId")).isNull();
58+
assertThat(actual.getTags()).doesNotContainKey("ai.operation.parentId");
5959
return this;
6060
}
6161

6262
@CanIgnoreReturnValue
6363
public DependencyAssert hasParent(String parentId) {
6464
isNotNull();
65-
assertThat(getDependencyData().getProperties().get("ai.operation.parentId"))
66-
.isEqualTo(parentId);
65+
assertThat(actual.getTags()).containsEntry("ai.operation.parentId", parentId);
6766
return this;
6867
}
6968

smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest/RequestAssert.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ public RequestAssert hasTag(String key, String value) {
4747
@CanIgnoreReturnValue
4848
public RequestAssert hasNoParent() {
4949
isNotNull();
50-
assertThat(getRequestData().getProperties().get("ai.operation.parentId")).isNull();
50+
assertThat(actual.getTags()).doesNotContainKey("ai.operation.parentId");
5151
return this;
5252
}
5353

5454
@CanIgnoreReturnValue
5555
public RequestAssert hasParent(String parentId) {
5656
isNotNull();
57-
assertThat(getRequestData().getProperties().get("ai.operation.parentId")).isEqualTo(parentId);
57+
assertThat(actual.getTags()).containsEntry("ai.operation.parentId", parentId);
5858
return this;
5959
}
6060

0 commit comments

Comments
 (0)