Skip to content

Commit

Permalink
Merge pull request #844 from iRevive/docs/testkit-sort-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
iRevive authored Nov 16, 2024
2 parents b56474e + 1e19c8b commit 11c4e3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/oteljava/testkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test: IO[Unit] =
// here you can use an assertion mechanism from your favorite testing framework
def assertMetrics(metrics: List[Metric], expected: List[TelemetryMetric]): IO[Unit] =
IO {
assert(metrics.map(TelemetryMetric.fromMetric) == expected)
assert(metrics.sortBy(_.name).map(TelemetryMetric.fromMetric) == expected)
}

// a minimized representation of the MetricData to simplify testing
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/testkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test: IO[Unit] =
// here you can use an assertion mechanism from your favorite testing framework
def assertMetrics(metrics: List[MetricData], expected: List[TelemetryMetric]): IO[Unit] =
IO {
assert(metrics.map(TelemetryMetric.fromMetricData) == expected)
assert(metrics.sortBy(_.name).map(TelemetryMetric.fromMetricData) == expected)
}

// a minimized representation of the MetricData to simplify testing
Expand Down

0 comments on commit 11c4e3a

Please sign in to comment.