Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Unreleased

### SDK

#### Testing

* Fix `LongExemplarAssert.hasFilteredAttributesSatisfyingExactly` to reject extra filtered
attributes, matching `DoubleExemplarAssert`
([#8518](https://github.com/open-telemetry/opentelemetry-java/pull/8518))

## Version 1.63.0 (2026-06-05)

### API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public LongExemplarAssert hasFilteredAttributesSatisfying(
*/
public LongExemplarAssert hasFilteredAttributesSatisfyingExactly(
AttributeAssertion... assertions) {
return hasFilteredAttributesSatisfying(Arrays.asList(assertions));
return hasFilteredAttributesSatisfyingExactly(Arrays.asList(assertions));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,26 @@ void longGaugeFailure() {
LENGTH,
val -> val.isCloseTo(1, offset(0.3))))))))
.isInstanceOf(AssertionError.class);
// hasFilteredAttributesSatisfyingExactly must reject extra filtered attributes. The exemplar
// has nine filtered attributes but only one is asserted, so the exact assertion must fail.
assertThatThrownBy(
() ->
assertThat(LONG_GAUGE_METRIC)
.hasLongGaugeSatisfying(
gauge ->
gauge.hasPointsSatisfying(
point ->
point
.hasValue(Long.MAX_VALUE)
.hasExemplarsSatisfying(
exemplar -> exemplar.hasValue(2),
exemplar ->
exemplar
.hasValue(1)
.hasFilteredAttributesSatisfyingExactly(
equalTo(BEAR, "mya"))),
point -> point.hasValue(1))))
.isInstanceOf(AssertionError.class);
}

@Test
Expand Down
Loading