### Question:
LOGBackConfigurer { public static void initLogging(String logConfigLocation, boolean installJULBridge) { try { String location = resolvePlaceholders(logConfigLocation); if (location.indexOf("${") >= 0) { throw new IllegalStateException("unable to resolve certain placeholders: " + sanitise(location)); } location = location.replaceAll("\\\\", "/"); String notice = "If you are watching the console output, it may stop after this point, if configured to only write to file."; Logger.getLogger(LOGBackConfigurer.class.getName()).info("Initializing LOGBack from [" + sanitise(location) + "]. " + notice); initLogging(getURL(location), installJULBridge); } catch (FileNotFoundException ex) { throw new IllegalArgumentException("invalid '" + sanitise(logConfigLocation) + "' parameter: " + ex.getMessage()); } } private  LOGBackConfigurer(); static void initLogging(String logConfigLocation, boolean installJULBridge); static void initLogging(URL url, boolean installJULBridge); static void shutdownLogging(boolean uninstallJULBridge);  }### Answer:
@Test public void canConfigureLoggingFromClasspath() { initLogging("classpath:conf/logback.xml", false); }
@Test public void canConfigureLoggingFromURL() { initLogging(LOGBackConfigurerTest.class.getResource("/conf/logback.xml"), false); }
@Test public void resolvesPlaceholdersBeforeInitializing() { System.setProperty("CONFIG_LOCATION", "classpath:"); initLogging("${CONFIG_LOCATION}conf/logback.xml", false); }
@Test public void failsForInvalidLogbackPath() { assertThrows(IllegalArgumentException.class, () -> initLogging(NON_EXISTENT_LOGBACK, false)); }