mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 11:38:35 +02:00
Isolate customizable code in activity reporting
Modularize the code for DNS count reporting to allow it to be customized for more flexible systems. Tested: Uploaded to alpha with hacks to allow admin initiating and logging from the DnsCountQueryCoordinatorModule, verified that the provider function is invoked and that the action runs successfully. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=225225587
This commit is contained in:
parent
6966151bed
commit
c396957d15
13 changed files with 208 additions and 12 deletions
|
@ -31,6 +31,10 @@ public class ActivityReportingQueryBuilderTest {
|
|||
ActivityReportingQueryBuilder queryBuilder = new ActivityReportingQueryBuilder();
|
||||
queryBuilder.yearMonth = new YearMonth(2017, 9);
|
||||
queryBuilder.projectId = "domain-registry-alpha";
|
||||
queryBuilder.dnsCountQueryCoordinator =
|
||||
new BasicDnsCountQueryCoordinator(
|
||||
new BasicDnsCountQueryCoordinator.Params(null, queryBuilder.yearMonth,
|
||||
queryBuilder.projectId));
|
||||
return queryBuilder;
|
||||
}
|
||||
|
||||
|
@ -63,5 +67,4 @@ public class ActivityReportingQueryBuilderTest {
|
|||
.isEqualTo(ReportingTestData.loadFile(testFilename));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ public class IcannReportingStagerTest {
|
|||
ActivityReportingQueryBuilder activityBuilder = new ActivityReportingQueryBuilder();
|
||||
activityBuilder.projectId = "test-project";
|
||||
activityBuilder.yearMonth = new YearMonth(2017, 6);
|
||||
activityBuilder.dnsCountQueryCoordinator = new BasicDnsCountQueryCoordinator(null);
|
||||
action.activityQueryBuilder = activityBuilder;
|
||||
TransactionsReportingQueryBuilder transactionsBuilder = new TransactionsReportingQueryBuilder();
|
||||
transactionsBuilder.projectId = "test-project";
|
||||
|
|
|
@ -52,4 +52,22 @@ public class TypeUtilsTest {
|
|||
.hasMessageThat()
|
||||
.contains("Failed to load class com.fake.company.nonexistent.Class");
|
||||
}
|
||||
|
||||
public static class ExampleClass {
|
||||
String val;
|
||||
|
||||
public ExampleClass(String val) {
|
||||
this.val = val;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_instantiateWithArg() {
|
||||
Class<ExampleClass> clazz =
|
||||
TypeUtils.getClassFromString(
|
||||
"google.registry.util.TypeUtilsTest$ExampleClass", ExampleClass.class);
|
||||
|
||||
ExampleClass result = TypeUtils.instantiate(clazz, "test");
|
||||
assertThat(result.val).isEqualTo("test");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue