From e45010f667c43c15e89c4c8d91d1073d2eb0a4f0 Mon Sep 17 00:00:00 2001 From: mmuller Date: Thu, 10 Aug 2017 12:39:46 -0700 Subject: [PATCH] Fix type-inference issues in our FOSS build Fix a few uses of Optional and any() in the IcannReporting test drivers so that they work on bazel in JDK7. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164888832 --- .../registry/reporting/IcannReportingStagingActionTest.java | 6 +++--- .../registry/reporting/IcannReportingUploadActionTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/javatests/google/registry/reporting/IcannReportingStagingActionTest.java b/javatests/google/registry/reporting/IcannReportingStagingActionTest.java index 545a60791..00fdbef65 100644 --- a/javatests/google/registry/reporting/IcannReportingStagingActionTest.java +++ b/javatests/google/registry/reporting/IcannReportingStagingActionTest.java @@ -77,13 +77,13 @@ public class IcannReportingStagingActionTest { @Test public void testRunSuccess() throws Exception { - when(bigquery.query(any(), any())).thenReturn(fakeFuture()); + when(bigquery.query(any(String.class), any(DestinationTable.class))).thenReturn(fakeFuture()); DestinationTable.Builder tableBuilder = new DestinationTable.Builder() .datasetId("testdataset") .type(TableType.TABLE) .name("tablename") .overwrite(true); - when(bigquery.buildDestinationTable(any())).thenReturn(tableBuilder); + when(bigquery.buildDestinationTable(any(String.class))).thenReturn(tableBuilder); ImmutableTable reportTable = new ImmutableTable.Builder() @@ -94,7 +94,7 @@ public class IcannReportingStagingActionTest { .put(2, new TableFieldSchema().setName("fooField"), "56") .put(2, new TableFieldSchema().setName("barField"), "78") .build(); - when(bigquery.queryToLocalTableSync(any())).thenReturn(reportTable); + when(bigquery.queryToLocalTableSync(any(String.class))).thenReturn(reportTable); IcannReportingStagingAction action = createAction(); action.run(); diff --git a/javatests/google/registry/reporting/IcannReportingUploadActionTest.java b/javatests/google/registry/reporting/IcannReportingUploadActionTest.java index e0f128a8f..b2a4ce9a8 100644 --- a/javatests/google/registry/reporting/IcannReportingUploadActionTest.java +++ b/javatests/google/registry/reporting/IcannReportingUploadActionTest.java @@ -172,7 +172,7 @@ public class IcannReportingUploadActionTest { public void testSuccess_CreateBucketname() throws Exception{ assertThat( IcannReportingUploadAction - .createReportingBucketName("gs://my-reporting", Optional.absent(), "2017-05")) + .createReportingBucketName("gs://my-reporting", Optional.absent(), "2017-05")) .isEqualTo("gs://my-reporting/icann/monthly/2017-05"); assertThat( IcannReportingUploadAction