HiveMultipleMetastoreCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request, Arrays.asList("HIVE"), true); } HiveMultipleMetastoreCheck(); @Override boolean isApplicable(PrereqCheckRequest request); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request);  }
@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"); Assert.assertFalse(m_check.isApplicable(request)); services.put("HIVE", Mockito.mock(Service.class)); Assert.assertTrue(m_check.isApplicable(request)); }