Last active
January 31, 2018 19:07
-
-
Save sanderploegsma/be9417e5b225082163e7998f7ebf6a0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PCollectionUtilsTest { | |
@get:Rule | |
private val pipeline : TestPipeline = TestPipeline.create() | |
@Test | |
fun `PCollection - filter should correctly filter items`() { | |
val input = pipeline.apply(Create.of(1, 2, 3, 4, 5)) | |
val output = input.filter { it > 3 } | |
PAssert.that(output).containsInAnyOrder(4, 5) | |
} | |
@Test | |
fun `PCollection - map should correctly map items`() { | |
val input = pipeline.apply(Create.of(1, 2, 3, 4, 5)) | |
val output = input.map { it > 3 } | |
PAssert.that(output).containsInAnyOrder(false, false, false, true, true) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment