@Test public void testLoadJsonException() throws Exception { try { SampleConf sampleConf = Configuration.loadJson(ConfigurationTest.class.getClassLoader().getResourceAsStream("sampleBad.json"), SampleConf.class); assert false; } catch (ConfigurationException e) { assert e.getCause() instanceof JsonException; } }
public final static <T extends Configuration> T loadJson(InputStream inputStream, Class<T> configClass) throws ConfigurationException { try { T config = ObjectMapper.getInstance().readValue(inputStream, configClass); return config; } catch (Exception e) { throw new ConfigurationException("Error when loading configuration file", e); } }
Configuration { public final static <T extends Configuration> T loadJson(InputStream inputStream, Class<T> configClass) throws ConfigurationException { try { T config = ObjectMapper.getInstance().readValue(inputStream, configClass); return config; } catch (Exception e) { throw new ConfigurationException("Error when loading configuration file", e); } } }
Configuration { public final static <T extends Configuration> T loadJson(InputStream inputStream, Class<T> configClass) throws ConfigurationException { try { T config = ObjectMapper.getInstance().readValue(inputStream, configClass); return config; } catch (Exception e) { throw new ConfigurationException("Error when loading configuration file", e); } }  }
Configuration { public final static <T extends Configuration> T loadJson(InputStream inputStream, Class<T> configClass) throws ConfigurationException { try { T config = ObjectMapper.getInstance().readValue(inputStream, configClass); return config; } catch (Exception e) { throw new ConfigurationException("Error when loading configuration file", e); } }  final static T loadJson(InputStream inputStream, Class<T> configClass); }
Configuration { public final static <T extends Configuration> T loadJson(InputStream inputStream, Class<T> configClass) throws ConfigurationException { try { T config = ObjectMapper.getInstance().readValue(inputStream, configClass); return config; } catch (Exception e) { throw new ConfigurationException("Error when loading configuration file", e); } }  final static T loadJson(InputStream inputStream, Class<T> configClass);  }