@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);
  PrereqCheckRequest request = new PrereqCheckRequest("cluster");
  request.setRepositoryVersion("2.3.0.0");
  // nothing installed
  Assert.assertFalse(m_check.isApplicable(request));
  // HDFS installed
  services.put("HDFS", Mockito.mock(Service.class));
  Assert.assertTrue(m_check.isApplicable(request));
  // OOZIE installed
  services.clear();
  services.put("OOZIE", Mockito.mock(Service.class));
  Assert.assertTrue(m_check.isApplicable(request));
}