APISonar


com.google.cloud.bigquery.FormatOptions.json

> com > google > cloud > bigquery > FormatOptions > json
com APIs google APIs cloud APIs bigquery APIs FormatOptions APIs json APIs

Example 1
public void PutBigQueryBatchBadRecordTest() throws Exception {
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        runner = setCredentialsControllerService(runner);
        runner.setProperty(AbstractGCPProcessor.GCP_CREDENTIALS_PROVIDER_SERVICE, CONTROLLER_SERVICE);
        runner.setProperty(BigQueryAttributes.DATASET_ATTR, dataset.getDatasetId().getDataset());
        runner.setProperty(BigQueryAttributes.TABLE_NAME_ATTR, methodName);
        runner.setProperty(BigQueryAttributes.SOURCE_TYPE_ATTR, FormatOptions.json().getType());
        runner.setProperty(BigQueryAttributes.TABLE_SCHEMA_ATTR, TABLE_SCHEMA_STRING);

        String str = "{\"field_1\":\"Daniel is great\"}\r\n";

        runner.enqueue(new ByteArrayInputStream(str.getBytes(StandardCharsets.UTF_8)));
        runner.run(1);
        runner.assertAllFlowFilesTransferred(AbstractBigQueryProcessor.REL_FAILURE, 1);
    }