@Test public void testGetTable() throws IOException { when(mockBigqueryTablesGet.execute()).thenReturn(fakeTable); Table table = helper.getTable(tableRef); verify(mockBigquery, times(1)).tables(); verify(mockBigqueryTables, times(1)).get(eq(projectId), eq(datasetId), eq(tableId)); verify(mockBigqueryTablesGet, times(1)).execute(); assertThat(fakeTable).isEqualTo(table); }
public Table getTable(TableReference tableRef) throws IOException { try { return service .tables() .get(tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()) .execute(); } catch (IOException ioe) { throw new IOException(String.format("Failed to get table '%s'", tableRef), ioe); } }
BigQueryHelper { public Table getTable(TableReference tableRef) throws IOException { try { return service .tables() .get(tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()) .execute(); } catch (IOException ioe) { throw new IOException(String.format("Failed to get table '%s'", tableRef), ioe); } } }
BigQueryHelper { public Table getTable(TableReference tableRef) throws IOException { try { return service .tables() .get(tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()) .execute(); } catch (IOException ioe) { throw new IOException(String.format("Failed to get table '%s'", tableRef), ioe); } } BigQueryHelper(Bigquery service); }
BigQueryHelper { public Table getTable(TableReference tableRef) throws IOException { try { return service .tables() .get(tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()) .execute(); } catch (IOException ioe) { throw new IOException(String.format("Failed to get table '%s'", tableRef), ioe); } } BigQueryHelper(Bigquery service); Bigquery getRawBigquery(); void importFederatedFromGcs(
      String projectId,
      TableReference tableRef,
      @Nullable TableSchema schema,
      BigQueryFileFormat sourceFormat,
      List<String> gcsPaths); void importFromGcs(
      String projectId,
      TableReference tableRef,
      @Nullable TableSchema schema,
      @Nullable TimePartitioning timePartitioning,
      @Nullable String kmsKeyName,
      BigQueryFileFormat sourceFormat,
      String createDisposition,
      String writeDisposition,
      List<String> gcsPaths,
      boolean awaitCompletion); void exportBigQueryToGcs(
      String projectId, TableReference tableRef, List<String> gcsPaths, boolean awaitCompletion); boolean tableExists(TableReference tableRef); Table getTable(TableReference tableRef); JobReference createJobReference(
      String projectId, String jobIdPrefix, @Nullable String location); void checkJobIdEquality(Job expected, Job actual); Job insertJobOrFetchDuplicate(String projectId, Job job); }
BigQueryHelper { public Table getTable(TableReference tableRef) throws IOException { try { return service .tables() .get(tableRef.getProjectId(), tableRef.getDatasetId(), tableRef.getTableId()) .execute(); } catch (IOException ioe) { throw new IOException(String.format("Failed to get table '%s'", tableRef), ioe); } } BigQueryHelper(Bigquery service); Bigquery getRawBigquery(); void importFederatedFromGcs(
      String projectId,
      TableReference tableRef,
      @Nullable TableSchema schema,
      BigQueryFileFormat sourceFormat,
      List<String> gcsPaths); void importFromGcs(
      String projectId,
      TableReference tableRef,
      @Nullable TableSchema schema,
      @Nullable TimePartitioning timePartitioning,
      @Nullable String kmsKeyName,
      BigQueryFileFormat sourceFormat,
      String createDisposition,
      String writeDisposition,
      List<String> gcsPaths,
      boolean awaitCompletion); void exportBigQueryToGcs(
      String projectId, TableReference tableRef, List<String> gcsPaths, boolean awaitCompletion); boolean tableExists(TableReference tableRef); Table getTable(TableReference tableRef); JobReference createJobReference(
      String projectId, String jobIdPrefix, @Nullable String location); void checkJobIdEquality(Job expected, Job actual); Job insertJobOrFetchDuplicate(String projectId, Job job); static final String BIGQUERY_JOB_ID_PATTERN; static final int BIGQUERY_JOB_ID_MAX_LENGTH; }