During the development and review process of the disk health indicator we noticed that it was hard to understand. Since we learnt a lot from the first round of development we want to go through the code one more time and restructure it.
server/src/test/java/org/elasticsearch/health/node/DiskHealthIndicatorServiceTests.java
assertThat(result.status(), equalTo(expectedStatus));
        assertThat(result.symptom(), equalTo("The cluster has enough available disk space."));
        assertThat(result.impacts().size(), equalTo(0));
        assertThat(result.diagnosisList().size(), equalTo(0));
        Map<String, Object> details = xContentToMap(result.details());
        assertThat(details.get("green_nodes"), equalTo(discoveryNodes.size()));
        assertThat(details.get("unknown_nodes"), equalTo(0));
        assertThat(details.get("yellow_nodes"), equalTo(0));
        assertThat(details.get("red_nodes"), equalTo(0));
        assertThat(details.get("blocked_indices"), equalTo(0));
    }
    /*
     * This method tests that we get the expected behavior when there are all role nodes with indices that report RED status and there are
     * no blocks in the cluster state. We expect 3 impacts and 1 diagnosis.
     */
    @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/90305")
    public void testNoBlockedIndicesAndRedAllRoleNodes() throws IOException {
        Set<DiscoveryNode> discoveryNodes = createNodesWithAllRoles();
        Map<String, Set<String>> indexNameToNodeIdsMap = new HashMap<>();
        Set<String> nodeIds = discoveryNodes.stream().map(DiscoveryNode::getId).collect(Collectors.toSet());
        for (int i = 0; i < randomIntBetween(1, 20); i++) {
            String indexName = randomAlphaOfLength(20);
            indexNameToNodeIdsMap.put(indexName, new HashSet<>(randomNonEmptySubsetOf(nodeIds)));
        }
        ClusterService clusterService = createClusterService(Set.of(), discoveryNodes, indexNameToNodeIdsMap);
        DiskHealthIndicatorService diskHealthIndicatorService = new DiskHealthIndicatorService(clusterService);
        HealthStatus expectedStatus = HealthStatus.RED;
        HealthInfo healthInfo = createHealthInfo(expectedStatus, discoveryNodes);
        HealthIndicatorResult result = diskHealthIndicatorService.calculate(true, healthInfo);
        assertThat(result.status(), equalTo(expectedStatus));