@Test
public void testPrivilegeCanNotStartWithAction() {

  KafkaPrivilegeValidator kafkaPrivilegeValidator = new KafkaPrivilegeValidator();
  try {
    kafkaPrivilegeValidator.validate(new PrivilegeValidatorContext("action=write->host=host1->topic=t1"));
    Assert.fail("Kafka privilege can not start with an action.");
  } catch (ConfigurationException ex) {
    Assert.assertEquals("Kafka privilege can not start with an action.\n" + KafkaPrivilegeValidator.KafkaPrivilegeHelpMsg, ex.getMessage());
  }
}