### Question:
BigQueryConfig { public Optional<@FileExists String> getCredentialsFile() { return credentialsFile; }  @AssertTrue(message = "Exactly one of 'bigquery.credentials-key' or 'bigquery.credentials-file' must be specified, or the default GoogleCredentials could be created") boolean isCredentialsConfigurationValid(); Optional<String> getCredentialsKey(); @Config("bigquery.credentials-key") @ConfigDescription("The base64 encoded credentials key") @ConfigSecuritySensitive BigQueryConfig setCredentialsKey(String credentialsKey); Optional<@FileExists String> getCredentialsFile(); @Config("bigquery.credentials-file") @ConfigDescription("The path to the JSON credentials file") BigQueryConfig setCredentialsFile(String credentialsFile); Optional<String> getProjectId(); @Config("bigquery.project-id") @ConfigDescription("The Google Cloud Project ID where the data reside") BigQueryConfig setProjectId(String projectId); Optional<String> getParentProjectId(); @Config("bigquery.parent-project-id") @ConfigDescription("The Google Cloud Project ID to bill for the export") BigQueryConfig setParentProjectId(String parentProjectId); OptionalInt getParallelism(); @Config("bigquery.parallelism") @ConfigDescription("The number of partitions to split the data into.") BigQueryConfig setParallelism(int parallelism); boolean isViewsEnabled(); @Config(VIEWS_ENABLED) @ConfigDescription("Enables the connector to read from views and not only tables") BigQueryConfig setViewsEnabled(boolean viewsEnabled); int getViewExpirationTimeInHours(); Optional<String> getViewMaterializationProject(); @Config("bigquery.view-materialization-project") @ConfigDescription("The project where the materialized view is going to be created") BigQueryConfig setViewMaterializationProject(String viewMaterializationProject); Optional<String> getViewMaterializationDataset(); @Config("bigquery.view-materialization-dataset") @ConfigDescription("The dataset where the materialized view is going to be created") BigQueryConfig setViewMaterializationDataset(String viewMaterializationDataset); @Min(0) int getMaxReadRowsRetries(); @Config("bigquery.max-read-rows-retries") @ConfigDescription("The number of retries in case of retryable server issues") BigQueryConfig setMaxReadRowsRetries(int maxReadRowsRetries); static final int DEFAULT_MAX_READ_ROWS_RETRIES; static final String VIEWS_ENABLED; }### Answer:
@Test public void testExplicitPropertyMappingsWithCredentialsFile() throws IOException { Path credentialsFile = Files.createTempFile(null, null); Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("bigquery.credentials-file", credentialsFile.toString()) .build(); ConfigurationFactory configurationFactory = new ConfigurationFactory(properties); BigQueryConfig config = configurationFactory.build(BigQueryConfig.class); assertEquals(config.getCredentialsFile(), Optional.of(credentialsFile.toString())); }