@Test
public void testPrivilegeMustHaveExcatlyOneHost() {

  KafkaPrivilegeValidator kafkaPrivilegeValidator = new KafkaPrivilegeValidator();
  try {
    kafkaPrivilegeValidator.validate(new PrivilegeValidatorContext("host=host1->host=host2->action=read"));
    Assert.fail("Multiple Host resources are not allowed within a Kafka privilege.");
  } catch (ConfigurationException ex) {
    Assert.assertEquals("Host authorizable can be specified just once in a Kafka privilege.\n" + KafkaPrivilegeValidator.KafkaPrivilegeHelpMsg, ex.getMessage());
  }
}