src/test/java/com/stijndepestel/geminio/ReplayTest.java
/**
     * Test that the replay is stopped gracefully.
     */
Test that the replay is stopped gracefully.
Test that the replay is stopped gracefully .
@Test
    public void eventsReplayedFailedTest() {
        this.replay = new Replay<>(TestHelper::deserialize,
                this::provideJSONForFailedReplay, event -> {/* ignore */
                });
        final TestReplayListener listener = new TestReplayListener();
        this.replay.addReplayListener(listener);
        this.replay.load().startReplay();
        Assert.assertTrue(
                "Should return true when stop request is succesfully received.",
                this.replay.stopReplay());
        Awaitility.await().atMost(1, TimeUnit.SECONDS)
                .until(this.hasReplayFailed(listener));
        Assert.assertEquals("Failed counter is 1", 1,
                listener.getFailedCounter());
    }
@ Test public void eventsReplayedFailedTest ( ) { this . replay = new Replay < > ( TestHelper :: deserialize , this :: provideJSONForFailedReplay , event -> { /* ignore */ } ) ; final TestReplayListener listener = new TestReplayListener ( ) ; this . replay . addReplayListener ( listener ) ; this . replay . load ( ) . startReplay ( ) ; Assert . assertTrue ( "Should return true when stop request is succesfully received." , this . replay . stopReplay ( ) ) ; Awaitility . await ( ) . atMost ( 1 , TimeUnit . SECONDS ) . until ( this . hasReplayFailed ( listener ) ) ; Assert . assertEquals ( "Failed counter is 1" , 1 , listener . getFailedCounter ( ) ) ; }
Test that the replay is stopped gracefully.
Test that the replay is stopped gracefully .