@Test public void testIsApplicable() throws Exception { final PrereqCheckRequest request = new PrereqCheckRequest("cluster"); request.setRepositoryVersion("not null"); HostsMasterMaintenanceCheck hmmc = new HostsMasterMaintenanceCheck(); Configuration config = Mockito.mock(Configuration.class); hmmc.config = config; Assert.assertTrue(hmmc.isApplicable(request)); Assert.assertTrue(new HostsMasterMaintenanceCheck().isApplicable(request)); HostsMasterMaintenanceCheck hmmc2 = new HostsMasterMaintenanceCheck(); hmmc2.config = config; Assert.assertTrue(hmmc2.isApplicable(request)); request.setRepositoryVersion(null); hmmc2.config = config; Assert.assertFalse(hmmc2.isApplicable(request)); }
@Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request) && request.getRepositoryVersion() != null; }
HostsMasterMaintenanceCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request) && request.getRepositoryVersion() != null; } }
HostsMasterMaintenanceCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request) && request.getRepositoryVersion() != null; } HostsMasterMaintenanceCheck(); }
HostsMasterMaintenanceCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request) && request.getRepositoryVersion() != null; } HostsMasterMaintenanceCheck(); @Override boolean isApplicable(PrereqCheckRequest request); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request); }
HostsMasterMaintenanceCheck extends AbstractCheckDescriptor { @Override public boolean isApplicable(PrereqCheckRequest request) throws AmbariException { return super.isApplicable(request) && request.getRepositoryVersion() != null; } HostsMasterMaintenanceCheck(); @Override boolean isApplicable(PrereqCheckRequest request); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request);  }