@SuppressWarnings("serial") @Test public void testIsApplicableMinimumStackVersion() throws Exception { final Cluster cluster = Mockito.mock(Cluster.class); Mockito.when(cluster.getClusterId()).thenReturn(1L); Mockito.when(cluster.getServices()).thenReturn(new HashMap<String, Service>() { { put("MAPREDUCE2", null); } }); Mockito.when(cluster.getCurrentStackVersion()).thenReturn(new StackId("MYSTACK-12.2")); ClusterVersionEntity clusterVersionEntity = Mockito.mock(ClusterVersionEntity.class); Mockito.when(cluster.getCurrentClusterVersion()).thenReturn(clusterVersionEntity); RepositoryVersionEntity repositoryVersionEntity = Mockito.mock(RepositoryVersionEntity.class); Mockito.when(clusterVersionEntity.getRepositoryVersion()).thenReturn(repositoryVersionEntity); Mockito.when(m_clusters.getCluster("c1")).thenReturn(cluster); PrereqCheckRequest request = new PrereqCheckRequest("c1"); Mockito.when(repositoryVersionEntity.getVersion()).thenReturn("2.0.0.1"); boolean isApplicable = m_check.isApplicable(request); Assert.assertTrue(isApplicable); }
@Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request, Arrays.asList("MAPREDUCE2"), true); }
MapReduce2JobHistoryStatePreservingCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request, Arrays.asList("MAPREDUCE2"), true); } }
MapReduce2JobHistoryStatePreservingCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request, Arrays.asList("MAPREDUCE2"), true); } MapReduce2JobHistoryStatePreservingCheck(); }
MapReduce2JobHistoryStatePreservingCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request, Arrays.asList("MAPREDUCE2"), true); } MapReduce2JobHistoryStatePreservingCheck(); @Override boolean isApplicable(PrereqCheckRequest request); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request); }
MapReduce2JobHistoryStatePreservingCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request, Arrays.asList("MAPREDUCE2"), true); } MapReduce2JobHistoryStatePreservingCheck(); @Override boolean isApplicable(PrereqCheckRequest request); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request);  }