use of com.google.api.services.dataflow.model.SourceOperationRequest in project beam by apache.
the class SourceOperationExecutorFactoryTest method testCreateWithFnApi.
@Test
public void testCreateWithFnApi() throws Exception {
SourceOperationRequest request = new SourceOperationRequest().setName("name").setOriginalName("original").setSystemName("system").setStageName("stage");
PipelineOptions options = PipelineOptionsFactory.fromArgs(new String[] { "--experiments=beam_fn_api" }).create();
assertThat(SourceOperationExecutorFactory.create(options, request, null, executionContext, "STAGE"), instanceOf(NoOpSourceOperationExecutor.class));
}
use of com.google.api.services.dataflow.model.SourceOperationRequest in project beam by apache.
the class SourceOperationExecutorFactoryTest method testCreateDefault.
@Test
public void testCreateDefault() throws Exception {
SourceOperationRequest request = new SourceOperationRequest().setName("name").setOriginalName("original").setSystemName("system").setStageName("stage").setSplit(new SourceSplitRequest());
DataflowOperationContext mockOperation = Mockito.mock(DataflowOperationContext.class);
Mockito.when(executionContext.createOperationContext(Mockito.isA(NameContext.class))).thenReturn(mockOperation);
SourceOperationExecutor sourceOperationExecutor = SourceOperationExecutorFactory.create(PipelineOptionsFactory.create(), request, null, executionContext, "STAGE");
assertThat(sourceOperationExecutor, instanceOf(WorkerCustomSourceOperationExecutor.class));
}
use of com.google.api.services.dataflow.model.SourceOperationRequest in project beam by apache.
the class NoOpSourceOperationExecutorTest method setUp.
@Before
public void setUp() {
SourceSplitRequest splitRequest = new SourceSplitRequest();
SourceOperationRequest operationRequest = new SourceOperationRequest().setSplit(splitRequest);
executor = new NoOpSourceOperationExecutor(operationRequest);
}
Aggregations