Skip to content

Commit

Permalink
This closes #2120
Browse files Browse the repository at this point in the history
  • Loading branch information
tgroh committed Mar 22, 2017
2 parents e1dc7a8 + f1badfd commit 2d9bf27
Showing 1 changed file with 15 additions and 0 deletions.
Expand Up @@ -22,6 +22,9 @@
import static org.apache.beam.sdk.TestUtils.LINES_ARRAY;
import static org.apache.beam.sdk.TestUtils.NO_LINES;
import static org.apache.beam.sdk.TestUtils.NO_LINES_ARRAY;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;

import com.google.common.collect.ImmutableSet;
import java.io.Serializable;
Expand Down Expand Up @@ -93,6 +96,18 @@ public void testFlattenPCollections() {
p.run();
}

@Test
@Category(RunnableOnService.class)
public void testFlattenPCollectionsSingletonList() {
PCollection<String> input = p.apply(Create.of(LINES));
PCollection<String> output = PCollectionList.of(input).apply(Flatten.<String>pCollections());

assertThat(output, not(equalTo(input)));

PAssert.that(output).containsInAnyOrder(LINES);
p.run();
}

@Test
@Category(RunnableOnService.class)
public void testFlattenPCollectionsThenParDo() {
Expand Down

0 comments on commit 2d9bf27

Please sign in to comment.