mirror of
https://github.com/google/nomulus
synced 2026-01-07 14:05:44 +00:00
Cleanup minor things in whitebox metrics code
Specifically: - remove @RequestScope from EppMetric since it's only for components - fix to call the better overload of toBigqueryTimestamp - use the same UUID provider for BigQueryMetricsEnqueuer that already exists for the VerifyEntityIntegrityStreamer - minor cleanup in VerifyEntityIntegrityStreamer (inject projectId vs whole env) ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=132721794
This commit is contained in:
@@ -21,6 +21,7 @@ import static org.mockito.Mockito.when;
|
||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||
import com.google.appengine.api.modules.ModulesService;
|
||||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.base.Suppliers;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
@@ -56,6 +57,7 @@ public class BigQueryMetricsEnqueuerTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
enqueuer = new BigQueryMetricsEnqueuer();
|
||||
enqueuer.idGenerator = Suppliers.ofInstance("laffo");
|
||||
enqueuer.modulesService = modulesService;
|
||||
when(modulesService.getVersionHostname(Matchers.anyString(), Matchers.anyString()))
|
||||
.thenReturn("1.backend.test.localhost");
|
||||
@@ -67,7 +69,7 @@ public class BigQueryMetricsEnqueuerTest {
|
||||
TestMetric.create(
|
||||
DateTime.parse("1984-12-18TZ"), DateTime.parse("1984-12-18TZ").plusMillis(1));
|
||||
|
||||
enqueuer.export(metric, "laffo");
|
||||
enqueuer.export(metric);
|
||||
|
||||
assertTasksEnqueued("bigquery-streaming-metrics",
|
||||
new TaskMatcher()
|
||||
|
||||
@@ -43,7 +43,6 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.googlecode.objectify.Key;
|
||||
import google.registry.bigquery.BigqueryFactory;
|
||||
import google.registry.config.RegistryEnvironment;
|
||||
import google.registry.mapreduce.MapreduceRunner;
|
||||
import google.registry.model.contact.ContactResource;
|
||||
import google.registry.model.domain.DomainResource;
|
||||
@@ -108,8 +107,8 @@ public class VerifyEntityIntegrityActionTest
|
||||
inject.setStaticField(VerifyEntityIntegrityAction.class, "component", component);
|
||||
integrity =
|
||||
new VerifyEntityIntegrityStreamer(
|
||||
"project-id",
|
||||
bigqueryFactory,
|
||||
RegistryEnvironment.UNITTEST,
|
||||
new Retrier(new FakeSleeper(new FakeClock()), 1),
|
||||
Suppliers.ofInstance("rowid"),
|
||||
now);
|
||||
|
||||
Reference in New Issue
Block a user