### Question:
ConfigUtil { public static String getUsecaseRootPath(Configuration config) { final String archiveRootPath = config.getStringValue(Configuration.KEY_MMS_ARCHIVE_ROOT); final String usecase; try { usecase = config.getStringValue(Configuration.KEY_MMS_USECASE); } catch (Exception e) { return archiveRootPath; } return archiveRootPath + File.separatorChar + usecase; }  static String getUsecaseRootPath(Configuration config); static TimeRange getTimeRange(String startKey, String stopKey, Configuration config);  }### Answer:
@Test public void testGetUsecaseRootPath() { final Configuration config = new Configuration(); config.put(Configuration.KEY_MMS_ARCHIVE_ROOT, "/archive"); config.put(Configuration.KEY_MMS_USECASE, "mms2"); final String path = ConfigUtil.getUsecaseRootPath(config); assertNotNull(path); assertEquals("/archive" + File.separatorChar + "mms2", path); }
@Test public void testGetUsecaseRootPath_missingUseCase() { final Configuration config = new Configuration(); config.put(Configuration.KEY_MMS_ARCHIVE_ROOT, "/archive"); final String path = ConfigUtil.getUsecaseRootPath(config); assertNotNull(path); assertEquals("/archive", path); }
@Test public void testGetUsecaseRootPath_missingRoot() { final Configuration config = new Configuration(); try { ConfigUtil.getUsecaseRootPath(config); fail("ToolException expected"); } catch (ToolException expected) { } }