use of io.cdap.cdap.etl.mock.common.MockPipelineConfigurer in project hydrator-plugins by cdapio.
the class DecompressorTest method testSchemaValidationWithValidInputSchema.
@Test
public void testSchemaValidationWithValidInputSchema() {
Transform<StructuredRecord, StructuredRecord> transform = new Decompressor(new Decompressor.Config("a:NONE", OUTPUT.toString()));
Schema validInput = Schema.recordOf("input", Schema.Field.of("a", Schema.of(Schema.Type.STRING)), Schema.Field.of("b", Schema.of(Schema.Type.STRING)));
MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(validInput);
transform.configurePipeline(mockPipelineConfigurer);
Assert.assertEquals(OUTPUT, mockPipelineConfigurer.getOutputSchema());
}
use of io.cdap.cdap.etl.mock.common.MockPipelineConfigurer in project hydrator-plugins by cdapio.
the class DecompressorTest method testSchemaValidation.
@Test
public void testSchemaValidation() {
Transform<StructuredRecord, StructuredRecord> transform = new Decompressor(new Decompressor.Config("a:ZIP", OUTPUT.toString()));
MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(INPUT);
transform.configurePipeline(mockPipelineConfigurer);
Assert.assertEquals(OUTPUT, mockPipelineConfigurer.getOutputSchema());
}
use of io.cdap.cdap.etl.mock.common.MockPipelineConfigurer in project hydrator-plugins by cdapio.
the class EncoderTest method testSchemaValidation.
@Test
public void testSchemaValidation() throws Exception {
Transform<StructuredRecord, StructuredRecord> transform = new Encoder(new Encoder.Config("a:BASE32", OUTPUTSTR.toString()));
MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(INPUT);
transform.configurePipeline(mockPipelineConfigurer);
Assert.assertEquals(OUTPUTSTR, mockPipelineConfigurer.getOutputSchema());
FailureCollector collector = mockPipelineConfigurer.getStageConfigurer().getFailureCollector();
Assert.assertEquals(0, collector.getValidationFailures().size());
}
use of io.cdap.cdap.etl.mock.common.MockPipelineConfigurer in project hydrator-plugins by cdapio.
the class SolrSearchSinkTest method testInvalidSingleNodeSolrUrl.
@Test(expected = IllegalArgumentException.class)
public void testInvalidSingleNodeSolrUrl() {
SolrSearchSink.BatchSolrSearchConfig config = new SolrSearchSink.BatchSolrSearchConfig("SolrSink", SolrSearchSinkConfig.SINGLE_NODE_MODE, "localhost:8983,localhost:8984", "collection1", "id", "office address:address", "1000");
SolrSearchSink sinkObject = new SolrSearchSink(config);
MockPipelineConfigurer configurer = new MockPipelineConfigurer(inputSchema);
sinkObject.configurePipeline(configurer);
}
use of io.cdap.cdap.etl.mock.common.MockPipelineConfigurer in project hydrator-plugins by cdapio.
the class HasherTest method testSchemaValidation.
@Test
public void testSchemaValidation() throws Exception {
Transform<StructuredRecord, StructuredRecord> transform = new Hasher(new Hasher.Config("SHA512", "a,b,e"));
MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(INPUT);
transform.configurePipeline(mockPipelineConfigurer);
Assert.assertEquals(INPUT, mockPipelineConfigurer.getOutputSchema());
}
Aggregations