@Test
  public void testWarningWhenHostWithVersionMismatchDoesNotExist() throws Exception {
    when(firstServiceComponentHosts.get(FIRST_SERVICE_COMPONENT_HOST_NAME).getUpgradeState()).thenReturn(IN_PROGRESS);

    ClusterInformation clusterInformation = new ClusterInformation(CLUSTER_NAME, false, null, null, null);
    UpgradeCheckRequest request = new UpgradeCheckRequest(clusterInformation, UpgradeType.ROLLING,
        null, null, null);

    UpgradeCheckResult check = versionMismatchCheck.perform(request);
    Assert.assertEquals(UpgradeCheckStatus.PASS, check.getStatus());
  }
Checks VersionMismatchCheck pre-upgrade check. Includes tests that emulate both
clusters with and without host components in VERSION_MISMATCH upgrade state.
ambari-server/src/test/java/org/apache/ambari/server/checks/VersionMismatchCheckTest.java