use of org.apache.ratis.server.RaftServerMXBean in project incubator-ratis by apache.
the class TestRaftServerJmx method runRegister.
static void runRegister(boolean expectToSucceed, String name, JmxRegister jmx) {
final RaftServerMXBean mBean = new RaftServerMXBean() {
@Override
public String getId() {
return null;
}
@Override
public String getLeaderId() {
return null;
}
@Override
public long getCurrentTerm() {
return 0;
}
@Override
public String getGroupId() {
return null;
}
@Override
public String getRole() {
return null;
}
@Override
public List<String> getFollowers() {
return null;
}
};
final RaftPeerId id = RaftPeerId.valueOf(name);
final RaftGroupId groupId = RaftGroupId.randomId();
final boolean succeeded = RaftServerImpl.registerMBean(id, groupId, mBean, jmx);
Assert.assertEquals(expectToSucceed, succeeded);
}
Aggregations