use of com.google.cloud.dataflow.examples.complete.game.UserScore.ExtractAndSumScore in project DataflowJavaSDK-examples by GoogleCloudPlatform.
the class UserScoreTest method testTeamScoreSums.
/** Tests ExtractAndSumScore("team"). */
@Test
@Category(ValidatesRunner.class)
public void testTeamScoreSums() throws Exception {
PCollection<String> input = p.apply(Create.of(GAME_EVENTS).withCoder(StringUtf8Coder.of()));
PCollection<KV<String, Integer>> output = input.apply(ParDo.of(new ParseEventFn())).apply("ExtractTeamScore", new ExtractAndSumScore("team"));
// Check the team score sums.
PAssert.that(output).containsInAnyOrder(TEAM_SUMS);
p.run().waitUntilFinish();
}
use of com.google.cloud.dataflow.examples.complete.game.UserScore.ExtractAndSumScore in project DataflowJavaSDK-examples by GoogleCloudPlatform.
the class UserScoreTest method testUserScoreSums.
/** Tests ExtractAndSumScore("user"). */
@Test
@Category(ValidatesRunner.class)
public void testUserScoreSums() throws Exception {
PCollection<String> input = p.apply(Create.of(GAME_EVENTS).withCoder(StringUtf8Coder.of()));
PCollection<KV<String, Integer>> output = input.apply(ParDo.of(new ParseEventFn())).apply("ExtractUserScore", new ExtractAndSumScore("user"));
// Check the user score sums.
PAssert.that(output).containsInAnyOrder(USER_SUMS);
p.run().waitUntilFinish();
}
Aggregations