mirror of
https://github.com/google/nomulus.git
synced 2025-08-02 16:02:10 +02:00
Refector metrics truth subject
The concrete implementation of a Metric is not of importance when asserting on the values it contains. Therefore this CL removes Metric<T> as a type parameter of AbstractMetricSubject. As a result the two implementations of the abstract subject can be used on any Metric<Long> and Metric<Distribution>, respectively. Also migrate to Subject.Factory from deprecated SubjectFactory. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=171012012
This commit is contained in:
parent
a9ecccf672
commit
9d8e48cf24
7 changed files with 60 additions and 74 deletions
|
@ -27,8 +27,8 @@ import static google.registry.model.registry.label.PremiumListUtils.deletePremiu
|
|||
import static google.registry.model.registry.label.PremiumListUtils.doesPremiumListExist;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.getPremiumPrice;
|
||||
import static google.registry.model.registry.label.PremiumListUtils.savePremiumListAndEntries;
|
||||
import static google.registry.monitoring.metrics.contrib.EventMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.IncrementableMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.DistributionMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.LongMetricSubject.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.loadPremiumListEntries;
|
||||
import static google.registry.testing.DatastoreHelper.persistPremiumList;
|
||||
|
|
|
@ -28,8 +28,8 @@ import static google.registry.model.registry.label.ReservationType.RESERVED_FOR_
|
|||
import static google.registry.model.registry.label.ReservedList.getAllowedNameservers;
|
||||
import static google.registry.model.registry.label.ReservedList.getReservationTypes;
|
||||
import static google.registry.model.registry.label.ReservedList.matchesAnchorTenantReservation;
|
||||
import static google.registry.monitoring.metrics.contrib.EventMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.IncrementableMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.DistributionMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.LongMetricSubject.assertThat;
|
||||
import static google.registry.testing.DatastoreHelper.createTld;
|
||||
import static google.registry.testing.DatastoreHelper.persistReservedList;
|
||||
import static google.registry.testing.DatastoreHelper.persistResource;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.monitoring.metrics.contrib;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.EventMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.DistributionMetricSubject.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -28,7 +28,7 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.JUnit4;
|
||||
|
||||
@RunWith(JUnit4.class)
|
||||
public class EventMetricSubjectTest {
|
||||
public class DistributionMetricSubjectTest {
|
||||
|
||||
private static final ImmutableSet<LabelDescriptor> LABEL_DESCRIPTORS =
|
||||
ImmutableSet.of(
|
|
@ -15,7 +15,7 @@
|
|||
package google.registry.monitoring.metrics.contrib;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.IncrementableMetricSubject.assertThat;
|
||||
import static google.registry.monitoring.metrics.contrib.LongMetricSubject.assertThat;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
@ -28,7 +28,7 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.JUnit4;
|
||||
|
||||
@RunWith(JUnit4.class)
|
||||
public class IncrementableMetricSubjectTest {
|
||||
public class LongMetricSubjectTest {
|
||||
|
||||
private static final ImmutableSet<LabelDescriptor> LABEL_DESCRIPTORS =
|
||||
ImmutableSet.of(
|
Loading…
Add table
Add a link
Reference in a new issue