consensus-bizur/src/test/java/com/mboysan/consensus/BizurNodeTest.java
/**
     * Tests the failure of set/get operations on any other node other than the leader when the leader is
     * killed/disconnected and there was no time to elect a new one.
     */
Tests the failure of set/get operations on any other node other than the leader when the leader is
killed/disconnected and there was no time to elect a new one.
Tests the failure of set / get operations on any other node other than the leader when the leader is killed / disconnected and there was no time to elect a new one .
@Test
    void testWhenLeaderKilledThenSetFailsOnOtherNode() throws Exception {
        int numServers = 3;
        init(numServers);
        int leaderId = assertOneLeader();
        kill(leaderId);
        assertThrows(ExecutionException.class, () -> getNode((leaderId + 1) % numServers).set("testKey", "testVal").get());
        assertThrows(ExecutionException.class, () -> getNode((leaderId + 2) % numServers).get("testKey").get());
    }
@ Test void testWhenLeaderKilledThenSetFailsOnOtherNode ( ) throws Exception { int numServers = 3 ; init ( numServers ) ; int leaderId = assertOneLeader ( ) ; kill ( leaderId ) ; assertThrows ( ExecutionException . class , ( ) -> getNode ( ( leaderId + 1 ) % numServers ) . set ( "testKey" , "testVal" ) . get ( ) ) ; assertThrows ( ExecutionException . class , ( ) -> getNode ( ( leaderId + 2 ) % numServers ) . get ( "testKey" ) . get ( ) ) ; }
Tests the failure of set/get operations on any other node other than the leader when the leader is
 killed/disconnected and there was no time to elect a new one.
Tests the failure of set / get operations on any other node other than the leader when the leader is killed / disconnected and there was no time to elect a new one .