### Question:
ConfigLoader { public static Class<?> loadCustomClass(String className) throws MappingException, ClassNotFoundException { Class<?> clazz = null; try { if (jarClassLoader != null || createJarClassLoader()) { clazz = jarClassLoader.loadClass(className); } else { throw new MappingException("cannot load custom jar"); } } catch (MalformedURLException e) { throw new MappingException("cannot load custom class", e); } return clazz; } private  ConfigLoader(); static void loadCustomHandlers(); static Class<?> loadCustomClass(String className); static List<MappingConfig> getConfig(); static void updateMapping(String name, MappingConfig value); static void removeMapping(String name); static void reloadConfigs(); static Map<String, MappingConfig> getLoadedMappings(); static Map<Integer, String> getLoadedGlobalErrors(); static void updateError(Integer status, String message); static void removeError(Integer status);  }### Answer:
@Test public void when_no_custom_jar_do_not_load_custom_class_and_throw_exception() throws Exception { ConfigLoader.jarClassLoader = null; String errorMsg = null; try { ConfigLoader.loadCustomClass(AddSenderIdInBodyAction.class.getCanonicalName()); } catch (MappingException e) { errorMsg = e.getMessage(); } assertEquals(errorMsg, "cannot load custom jar"); }