mirror of
https://github.com/google/nomulus
synced 2026-10-01 12:16:02 +00: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:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user