@Test
public void testPerform() throws Exception {

  final Cluster cluster = Mockito.mock(Cluster.class);
  final Map<String, Service> services = new HashMap<>();
  final Service service = Mockito.mock(Service.class);
  services.put("KAFKA", service);
  Mockito.when(cluster.getServices()).thenReturn(services);
  Mockito.when(cluster.getClusterId()).thenReturn(1L);
  Mockito.when(cluster.getSecurityType()).thenReturn(SecurityType.KERBEROS);
  Mockito.when(clusters.getCluster("cluster")).thenReturn(cluster);
  PrerequisiteCheck check = new PrerequisiteCheck(null, null);
  kafkaKerberosCheck.perform(check, new PrereqCheckRequest("cluster"));
  Assert.assertEquals(PrereqCheckStatus.WARNING, check.getStatus());
  check = new PrerequisiteCheck(null, null);
  Mockito.when(cluster.getSecurityType()).thenReturn(SecurityType.NONE);
  kafkaKerberosCheck.perform(check, new PrereqCheckRequest("cluster"));
  Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());
}