### Question:
JMSTopicService implements Service { @Override public void init(Services services) throws ServiceException { LOG = XLog.getLog(getClass()); conf = services.getConf(); parseTopicConfiguration(); topicPrefix = conf.get(TOPIC_PREFIX, ""); }  @Override void init(Services services); String getTopic(String jobId); String getTopic(AppType appType, String user, String jobId, String parentJobId); Properties getTopicPatternProperties(); String getTopicPrefix(); @Override void destroy(); @Override Class<? extends Service> getInterface(); static final String CONF_PREFIX; static final String TOPIC_NAME; static final String TOPIC_PREFIX; }### Answer:
@Test public void testIncorrectConfigurationJobType() { try { services = setupServicesForTopic(); services.getConf().set(JMSTopicService.TOPIC_NAME, "InvalidJobType" + " = workflow," + JMSTopicService.JobType.COORDINATOR.getValue() + "=coord"); services.init(); fail("Expected Service Exception"); } catch (ServiceException se) { assertTrue(se.getMessage().contains("Incorrect job type")); } }
@Test public void testIncorrectConfigurationDefault() { try { services = setupServicesForTopic(); services.getConf().set(JMSTopicService.TOPIC_NAME, "default=" + "invalidvalue"); services.init(); fail("Expected Service Exception"); } catch (ServiceException se) { assertTrue(se.getMessage().contains("not allowed in default")); } }