Last active
October 20, 2020 15:20
-
-
Save mgryszko/88c86182c0c085f7b99bd1d0075a6f29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MeteredCacheTest { | |
Meter gets = new Meter(); | |
Meter puts = new Meter(); | |
Meter hits = new Meter(); | |
MetricRegistry metrics = new MetricRegistry(); | |
Cache delegate = mock<Cache>(); | |
Cache cache = new MeteredCache(delegate, metrics); | |
@Test | |
void getAndPut() { | |
registerMetrics(); | |
// test cache and check generated metrics | |
} | |
void registerMetrics() { | |
metrics.register("gets", puts); | |
metrics.register("puts", puts); | |
metrics.register("hits", hits); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment