### Question:
MessagingSystemCheck extends AbstractMasterCheck { @Override public void run() throws Exception { MessagingServiceUtils.getSystemTopics(cConf, false); LOG.info("Messaging System configurations verified."); } @Inject  MessagingSystemCheck(CConfiguration cConf); @Override void run();  }### Answer:
@Test public void testValid() throws Exception { CConfiguration cConf = CConfiguration.create(); new MessagingSystemCheck(cConf).run(); }
@Test (expected = IllegalArgumentException.class) public void testInvalidTopic() throws Exception { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.MessagingSystem.SYSTEM_TOPICS, "invalid.topic"); new MessagingSystemCheck(cConf).run(); }
@Test (expected = IllegalArgumentException.class) public void testInvalidTopicNumber() throws Exception { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.MessagingSystem.SYSTEM_TOPICS, "topic:xyz"); new MessagingSystemCheck(cConf).run(); }
@Test (expected = IllegalArgumentException.class) public void testNegativeTopicNumber() throws Exception { CConfiguration cConf = CConfiguration.create(); cConf.set(Constants.MessagingSystem.SYSTEM_TOPICS, "topic:-10"); new MessagingSystemCheck(cConf).run(); }