mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Add a convenient method to DistributionMetricSubject
Currently to assert that a given Metric<Distribution> as a certain distribution for some labels, the caller needs to manually create an ImmutableDistribution and pass it to #hasValueForLabels method. With this change, an ImmutableSet of data points can be passed to #hasDataSetForLabels method. Also switched to use expectThrow backport from JUnit 4.13. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173544521
This commit is contained in:
parent
4a9b8b918a
commit
4a5b9fc288
4 changed files with 135 additions and 38 deletions
|
@ -107,7 +107,7 @@ abstract class AbstractMetricSubject<T, S extends AbstractMetricSubject<T, S>>
|
|||
}
|
||||
if (!metricPoint.value().equals(value)) {
|
||||
failWithBadResults(
|
||||
String.format("has a value of %s for labels", value),
|
||||
String.format("has a value of %s for labels", getMessageRepresentation(value)),
|
||||
Joiner.on(':').join(labels),
|
||||
"has a value of",
|
||||
getMessageRepresentation(metricPoint.value()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue