public class TestBigQuery
extends java.lang.Object
implements org.junit.rules.TestRule
Deletes the table on test shutdown.
Modifier and Type | Class and Description |
---|---|
static interface |
TestBigQuery.PollingAssertion
Interface to implement a polling assertion.
|
class |
TestBigQuery.RowsAssertion
Interface for creating a polling eventual assertion.
|
Modifier and Type | Method and Description |
---|---|
Statement |
apply(Statement base,
org.junit.runner.Description description) |
TestBigQuery.RowsAssertion |
assertThatAllRows(Schema rowSchema) |
static TestBigQuery |
create(Schema tableSchema)
Creates an instance of this rule.
|
java.util.List<Row> |
getFlatJsonRows(Schema rowSchema)
|
TableDataInsertAllResponse |
insertRows(Schema rowSchema,
Row... rows) |
TableReference |
tableReference() |
java.lang.String |
tableSpec() |
@Experimental(value=SCHEMAS) public static TestBigQuery create(Schema tableSchema)
Loads GCP configuration from TestPipelineOptions
.
public Statement apply(Statement base, org.junit.runner.Description description)
apply
in interface org.junit.rules.TestRule
public java.lang.String tableSpec()
public TableReference tableReference()
@Experimental(value=SCHEMAS) public TableDataInsertAllResponse insertRows(Schema rowSchema, Row... rows) throws java.io.IOException
java.io.IOException
@Experimental(value=SCHEMAS) public java.util.List<Row> getFlatJsonRows(Schema rowSchema)
Rows
with given Schema
.
Current implementation only supports flat Rows
and target Schemas
with Schema.FieldType.STRING
fields only.
@Experimental(value=SCHEMAS) public TestBigQuery.RowsAssertion assertThatAllRows(Schema rowSchema)