Skip to content

Commit

Permalink
Remove usages of NoopObservationRegistry.INSTANCE
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatan-ivanov committed Sep 23, 2023
1 parent 5253a59 commit e50fe21
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@ void observeWithFunction() {
}
};
AtomicReference<Context> passedContextHolder = new AtomicReference<>();
result = Observation.createNotStarted("service", supplier, NoopObservationRegistry.INSTANCE)
result = Observation.createNotStarted("service", supplier, ObservationRegistry.NOOP)
.observeWithContext((ctx) -> {
passedContextHolder.set(ctx);
return "World";
});
assertThat(passedContextHolder).as("passed a noop context").hasValue(NoopObservation.NOOP.getContext());
assertThat(passedContextHolder).as("passed a noop context").hasValue(Observation.NOOP.getContext());
assertThat(contextCreated).isFalse();
assertThat(result).isEqualTo("World");
}
Expand Down

0 comments on commit e50fe21

Please sign in to comment.