@Test
public void testPerform() throws Exception {

  // no existing upgrades
  Mockito.when(cluster.getUpgradeInProgress()).thenReturn(null);
  PrerequisiteCheck check = new PrerequisiteCheck(null, null);
  puc.perform(check, checkRequest);
  Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());
  // existing upgrade
  UpgradeEntity upgradeInProgress = Mockito.mock(UpgradeEntity.class);
  Mockito.when(upgradeInProgress.getDirection()).thenReturn(Direction.UPGRADE);
  Mockito.when(upgradeInProgress.getClusterId()).thenReturn(1L);
  Mockito.when(upgradeInProgress.getFromVersion()).thenReturn(sourceRepositoryVersion);
  Mockito.when(upgradeInProgress.getToVersion()).thenReturn(destRepositoryVersion);
  Mockito.when(cluster.getUpgradeInProgress()).thenReturn(upgradeInProgress);
  check = new PrerequisiteCheck(null, null);
  puc.perform(check, checkRequest);
  Assert.assertEquals(PrereqCheckStatus.FAIL, check.getStatus());
}