Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import io.micrometer.core.instrument.search.MeterNotFoundException;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;

import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;


/**
* @author Erin Schnabel
Expand Down Expand Up @@ -136,10 +139,11 @@ public void testMicrometerMetrics() {
}

void verifyMeterNotFoundException(String name) {
try {
registry.get(name).meter();
Assert.fail(name + " should not have been found");
} catch(MeterNotFoundException mnfe) {
}
MeterNotFoundException ex = assertThrows(
MeterNotFoundException.class,
() -> registry.get( name ).meter(), name + " should not have been found"
);
assertTrue( ex.getMessage().contains( name ) );

}
}
Loading