package org.apache.beam.runners.spark.structuredstreaming;

import org.apache.beam.sdk.Pipeline;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.transforms.Create;

/**
 * Test class for beam to spark source translation.
 */
public class SourceTest {
  public static void main(String[] args) {
    PipelineOptions options = PipelineOptionsFactory.fromArgs(args).create();
    Pipeline pipeline = Pipeline.create(options);
    pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
    pipeline.run();
  }

}

@@ -246,16 +246,69 @@
 .Create;
+%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;
 %0A%0A/**%0A *
@@ -387,16 +387,68 @@
 eTest %7B%0A
+  private static Pipeline pipeline;%0A%0A  @BeforeClass%0A
   public
@@ -464,28 +464,21 @@
 oid 
-main(String%5B%5D args) 
+beforeClass()
 %7B%0A  
@@ -532,82 +532,179 @@
 ory.
-fromArgs(args).create();%0A    Pipeline pipeline = Pipeline.create(options);
+create().as(SparkPipelineOptions.class);%0A    options.setRunner(SparkRunner.class);%0A    pipeline = Pipeline.create(options);%0A  %7D%0A%0A  @Test%0A  public void testBoundedSource()%7B
 %0A   

Refactor SourceTest to a UTest instaed of a main