@Test
public void testApplicable() throws Exception {

  final Service service = EasyMock.createMock(Service.class);
  Map<String, Service> services = new HashMap<>();
  services.put("RANGER", service);
  Cluster cluster = m_clusters.getCluster("cluster");
  EasyMock.reset(cluster);
  expect(cluster.getServices()).andReturn(services).anyTimes();
  expect(cluster.getCurrentStackVersion()).andReturn(new StackId("HDP-2.3")).anyTimes();
  replay(cluster);
  PrereqCheckRequest request = new PrereqCheckRequest("cluster");
  request.setSourceStackId(new StackId("HDP-2.3"));
  assertTrue(m_rpc.isApplicable(request));
  request = new PrereqCheckRequest("cluster");
  request.setSourceStackId(new StackId("HDP-2.2"));
  assertFalse(m_rpc.isApplicable(request));
  EasyMock.reset(cluster);
  expect(cluster.getServices()).andReturn(services).anyTimes();
  expect(cluster.getCurrentStackVersion()).andReturn(new StackId("WILDSTACK-2.0")).anyTimes();
  replay(cluster);
  request = new PrereqCheckRequest("cluster");
  request.setSourceStackId(new StackId("HDP-2.2"));
  assertTrue(m_rpc.isApplicable(request));
}