Skip to content

Instantly share code, notes, and snippets.

@jponge
Created January 18, 2018 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jponge/079120cd9cc5a4b4ec07e771b06e8805 to your computer and use it in GitHub Desktop.
Save jponge/079120cd9cc5a4b4ec07e771b06e8805 to your computer and use it in GitHub Desktop.
@Test
@DisplayName("⏱ Count 3 timer ticks")
void countThreeTicks(Vertx vertx, VertxTestContext testContext) {
AtomicInteger counter = new AtomicInteger();
vertx.setPeriodic(100, id -> {
if (counter.incrementAndGet() == 3) {
testContext.completeNow();
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment