@Test
public void testIsApplicable() throws Exception {

  final HiveNotRollingWarning hiveWarningCheck = new HiveNotRollingWarning();
  hiveWarningCheck.clustersProvider = new Provider<Clusters>() {
    @Override
    public Clusters get() {
      return m_clusters;
    }
  };
  final Cluster cluster = niceMock(Cluster.class);
  final Service hive = niceMock(Service.class);
  final Map<String, Service> services = new HashMap<>();
  services.put("HIVE", hive);
  EasyMock.expect(cluster.getClusterId()).andReturn(1L).anyTimes();
  EasyMock.expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP", "2.3")).anyTimes();
  EasyMock.expect(cluster.getServices()).andReturn(services).atLeastOnce();
  EasyMock.expect(m_clusters.getCluster(m_clusterName)).andReturn(cluster).atLeastOnce();
  PrereqCheckRequest request = niceMock(PrereqCheckRequest.class);
  EasyMock.expect(request.getClusterName()).andReturn(m_clusterName);
  EasyMock.expect(request.getUpgradeType()).andReturn(UpgradeType.ROLLING);
  replayAll();
  Assert.assertTrue(hiveWarningCheck.isApplicable(request));
  verifyAll();
}