lukecwik commented on a change in pull request #11199: [BEAM-9562] Update Timer
encoding with respect of dynamic timers
URL: https://github.com/apache/beam/pull/11199#discussion_r402431150
##########
File path:
runners/core-construction-java/src/test/java/org/apache/beam/runners/core/construction/TimerTest.java
##########
@@ -36,39 +38,121 @@
private static final Instant INSTANT = Instant.now();
@Test
- public void testTimer() {
- Timer<Void> timerA = Timer.of(INSTANT);
- assertEquals(INSTANT, timerA.getTimestamp());
- assertNull(timerA.getPayload());
+ public void testClearTimer() {
+ Timer<String> clearedTimer = Timer.cleared("timer", "tag");
+ assertTrue(clearedTimer.getClearBit());
+ assertEquals("timer", clearedTimer.getUserKey());
+ assertEquals("tag", clearedTimer.getDynamicTimerTag());
+ }
- Timer<String> timerB = Timer.of(INSTANT, "ABC");
- assertEquals(INSTANT, timerB.getTimestamp());
- assertEquals("ABC", timerB.getPayload());
+ @Test
+ public void testTimer() {
+ Timer<String> timer =
+ Timer.of(
+ "key",
+ "tag",
+ INSTANT,
Review comment:
use two different instant objects otherwise you can't tell if they get
swapped accidentally
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services