### Question:
CoreStatus extends BaseStatus { @Override public Response description() { MemberId myself = topologyService.myself(); MemberId leader = getLeader(); List<MemberId> votingMembers = new ArrayList<>( raftMembershipManager.votingMembers() ); boolean participatingInRaftGroup = votingMembers.contains( myself ) && Objects.nonNull( leader ); long lastAppliedRaftIndex = commandIndexTracker.getAppliedCommandIndex(); final Duration millisSinceLastLeaderMessage; if ( myself.equals( leader ) ) { millisSinceLastLeaderMessage = Duration.ofMillis( 0 ); } else { millisSinceLastLeaderMessage = raftMessageTimerResetMonitor.durationSinceLastMessage(); } return statusResponse( lastAppliedRaftIndex, participatingInRaftGroup, votingMembers, databaseHealth.isHealthy(), myself, leader, millisSinceLastLeaderMessage, true ); } CoreStatus( OutputFormat output, CoreGraphDatabase db ); @Override Response discover(); @Override Response available(); @Override Response readonly(); @Override Response writable(); @Override Response description();  }### Answer:
@Test public void notParticipatingInRaftGroupWhenNotInVoterSet() throws IOException { topologyService.replaceWithRole( core2, RoleInfo.LEADER ); when( raftMembershipManager.votingMembers() ).thenReturn( new HashSet<>( Arrays.asList( core2, core3 ) ) ); Response description = status.description(); Map<String,Object> response = responseAsMap( description ); assertThat( response, containsAndEquals( "participatingInRaftGroup", false ) ); }
@Test public void notParticipatingInRaftGroupWhenLeaderUnknown() throws IOException { topologyService.replaceWithRole( null, RoleInfo.LEADER ); Response description = status.description(); Map<String,Object> response = responseAsMap( description ); assertThat( response, containsAndEquals( "participatingInRaftGroup", false ) ); }
@Test public void databaseHealthIsReflected() throws IOException { databaseHealth.panic( new RuntimeException() ); Response description = status.description(); Map<String,Object> response = responseAsMap( description ); assertThat( response, containsAndEquals( "healthy", false ) ); }
@Test public void leaderNotIncludedIfUnknown() throws IOException { topologyService.replaceWithRole( null, RoleInfo.LEADER ); Response description = status.description(); Map<String,Object> response = responseAsMap( description ); assertFalse( description.getEntity().toString(), response.containsKey( "leader" ) ); }