@Test public void testUpgrade() { NodeGroup group = new NodeGroup(new NodeEndpoint("A", "localhost", 2333)); NodeEndpoint endpoint = new NodeEndpoint("B", "localhost", 2334); group.addNode(endpoint, 1, 0, false); Assert.assertEquals(1, group.getCountOfMajor()); group.upgrade(endpoint.getId()); Assert.assertEquals(2, group.getCountOfMajor()); }
void upgrade(NodeId id) { logger.info("upgrade node {}", id); findMember(id).setMajor(true); }
NodeGroup { void upgrade(NodeId id) { logger.info("upgrade node {}", id); findMember(id).setMajor(true); } }
NodeGroup { void upgrade(NodeId id) { logger.info("upgrade node {}", id); findMember(id).setMajor(true); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId); }
NodeGroup { void upgrade(NodeId id) { logger.info("upgrade node {}", id); findMember(id).setMajor(true); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);  }
NodeGroup { void upgrade(NodeId id) { logger.info("upgrade node {}", id); findMember(id).setMajor(true); } NodeGroup(NodeEndpoint endpoint);   NodeGroup(Collection<NodeEndpoint> endpoints, NodeId selfId);   }