RedisKeeperServerStateActive extends AbstractRedisKeeperServerState { @Override public void becomeBackup(Endpoint masterAddress){ logger.info("[becomeBackup]{}", masterAddress); doBecomeBackup(masterAddress); } RedisKeeperServerStateActive(RedisKeeperServer redisKeeperServer);  RedisKeeperServerStateActive(RedisKeeperServer redisKeeperServer, Endpoint masterAddress); @Override void becomeBackup(Endpoint masterAddress); @Override void becomeActive(Endpoint masterAddress); @Override void setPromotionState(PROMOTION_STATE promotionState, Object info); @SuppressWarnings("deprecation") RedisMeta masterChanged(long keeperOffset, DefaultEndPoint newMasterEndpoint, String newMasterRunid, long newMasterReplOffset); @Override boolean psync(RedisClient redisClient, String []args); @Override void initPromotionState(); @Override KeeperState keeperState(); @Override boolean handleSlaveOf();  }
@Test public void testActiveBackup() throws IOException{ active.becomeBackup(new DefaultEndPoint("localhost", randomPort())); Assert.assertTrue(redisKeeperServer.getRedisKeeperServerState() instanceof RedisKeeperServerStateBackup); }