diff options
author | Ivan Topolnjak <ivantopo@gmail.com> | 2017-11-13 14:17:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-13 14:17:05 +0100 |
commit | 018cd65f011b3aef4251a923a66f4142434e52d7 (patch) | |
tree | b2feb52d698587be46cd3c98bb403f9c3df70198 /kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala | |
parent | 7a21134e8e0b2296ec98061643ada2e3f68d479a (diff) | |
parent | 2fed24c227af6cd16aa517615f237977dd1a447b (diff) | |
download | Kamon-018cd65f011b3aef4251a923a66f4142434e52d7.tar.gz Kamon-018cd65f011b3aef4251a923a66f4142434e52d7.tar.bz2 Kamon-018cd65f011b3aef4251a923a66f4142434e52d7.zip |
Merge pull request #489 from kamon-io/refineWithJMap
Metric::refine with java.util.Map
Diffstat (limited to 'kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala')
-rw-r--r-- | kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala b/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala index 64ae1514..4df2397b 100644 --- a/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala +++ b/kamon-core-tests/src/test/scala/kamon/metric/MetricLookupSpec.scala @@ -15,6 +15,8 @@ package kamon.metric +import java.util.Collections.{singletonMap => javaMap} + import kamon.Kamon import org.scalatest.{Matchers, WordSpec} @@ -51,27 +53,38 @@ class MetricLookupSpec extends WordSpec with Matchers { "always return the same histogram for a set of tags" in { val histogramOne = Kamon.histogram("histogram-lookup").refine("tag" -> "value") val histogramTwo = Kamon.histogram("histogram-lookup").refine("tag" -> "value") + val histogramThree = Kamon.histogram("histogram-lookup").refine(javaMap("tag", "value")) + histogramOne shouldBe theSameInstanceAs(histogramTwo) + histogramOne shouldBe theSameInstanceAs(histogramThree) } "always return the same counter for a set of tags" in { val counterOne = Kamon.counter("counter-lookup").refine("tag" -> "value") val counterTwo = Kamon.counter("counter-lookup").refine("tag" -> "value") + val counterThree = Kamon.counter("counter-lookup").refine(javaMap("tag", "value")) + counterOne shouldBe theSameInstanceAs(counterTwo) + counterOne shouldBe theSameInstanceAs(counterThree) } "always return the same gauge for a set of tags" in { val gaugeOne = Kamon.gauge("gauge-lookup").refine("tag" -> "value") val gaugeTwo = Kamon.gauge("gauge-lookup").refine("tag" -> "value") + val gaugeThree = Kamon.gauge("gauge-lookup").refine(javaMap("tag", "value")) + gaugeOne shouldBe theSameInstanceAs(gaugeTwo) + gaugeOne shouldBe theSameInstanceAs(gaugeThree) } "always return the same min-max-counter for a set of tags" in { val minMaxCounterOne = Kamon.minMaxCounter("min-max-counter-lookup").refine("tag" -> "value") val minMaxCounterTwo = Kamon.minMaxCounter("min-max-counter-lookup").refine("tag" -> "value") + val minMaxCounterThree = Kamon.minMaxCounter("min-max-counter-lookup").refine(javaMap("tag", "value")) + minMaxCounterOne shouldBe theSameInstanceAs(minMaxCounterTwo) + minMaxCounterOne shouldBe theSameInstanceAs(minMaxCounterThree) } } } - } |