### Question:
MultiLangDaemon { void configureLogging(final String logConfiguration) { if (StringUtils.isNotEmpty(logConfiguration)) { LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); configureLogging(logConfiguration, loggerContext, configurator); } }  static void main(final String[] args);  }### Answer:
@Test public void testSuccessfulLoggingConfiguration() { LoggerContext loggerContext = spy((LoggerContext) LoggerFactory.getILoggerFactory()); JoranConfigurator configurator = spy(new JoranConfigurator()); String logConfiguration = this.getClass().getClassLoader().getResource("logback.xml").getPath(); daemon.configureLogging(logConfiguration, loggerContext, configurator); verify(loggerContext).reset(); verify(configurator).setContext(eq(loggerContext)); }
@Test public void testUnsuccessfulLoggingConfiguration() { LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); JoranConfigurator configurator = new JoranConfigurator(); expectedException.expect(RuntimeException.class); expectedException.expectMessage(containsString("Error while loading log configuration:")); String logConfiguration = "blahblahblah"; daemon.configureLogging(logConfiguration, loggerContext, configurator); }