@Test
public void testIsApplicable() throws Exception {

  final Cluster cluster = Mockito.mock(Cluster.class);
  Mockito.when(cluster.getClusterId()).thenReturn(1L);
  Mockito.when(m_clusters.getCluster("cluster")).thenReturn(cluster);
  Map<String, Service> services = new HashMap<String, Service>();
  Mockito.when(cluster.getServices()).thenReturn(services);
  services.put("HDFS", Mockito.mock(Service.class));
  PrereqCheckRequest request = new PrereqCheckRequest("cluster");
  request.setRepositoryVersion("2.3.0.0");
  // HIVE not installed
  Assert.assertFalse(m_check.isApplicable(request));
  // install HIVE
  services.put("HIVE", Mockito.mock(Service.class));
  // HIVE installed
  Assert.assertTrue(m_check.isApplicable(request));
}