use of org.apache.beam.runners.portability.testing.TestJobService in project beam by apache.
the class PortableRunnerTest method createJobServer.
private void createJobServer(JobState.Enum jobState, JobApi.MetricResults metricResults) throws IOException {
ArtifactStagingService stagingService = new ArtifactStagingService(new ArtifactStagingService.ArtifactDestinationProvider() {
@Override
public ArtifactStagingService.ArtifactDestination getDestination(String stagingToken, String name) throws IOException {
return ArtifactStagingService.ArtifactDestination.create("/dev/null", ByteString.EMPTY, ByteStreams.nullOutputStream());
}
@Override
public void removeStagedArtifacts(String stagingToken) {
}
});
stagingService.registerJob("TestStagingToken", ImmutableMap.of());
Server server = grpcCleanupRule.register(InProcessServerBuilder.forName(ENDPOINT_URL).addService(new TestJobService(ENDPOINT_DESCRIPTOR, "prepId", "jobId", jobState, metricResults)).addService(stagingService).build());
server.start();
}
Aggregations