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
This commit is contained in:
mmuller 2017-08-10 12:39:46 -07:00 committed by Ben McIlwain
parent 4de8d3eae1
commit e45010f667
2 changed files with 4 additions and 4 deletions

View file

@ -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<Integer, TableFieldSchema, Object> reportTable =
new ImmutableTable.Builder<Integer, TableFieldSchema, Object>()
@ -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();

View file

@ -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.<String>absent(), "2017-05"))
.isEqualTo("gs://my-reporting/icann/monthly/2017-05");
assertThat(
IcannReportingUploadAction