@Test public void testPublicationReader() throws Exception { final String filePath = "src/test/resources/stage_config.json"; final Publication readObject = new PublicationReader().read(filePath, Publication.class); assertThat(readObject, notNullValue()); assertThat(readObject.getHost(), is("https: assertThat(readObject.getPort(), is(443)); assertThat(readObject.getApis().size(), is(2)); readObject.getApis().forEach(e -> { assertThat(e.getApiConfig(), notNullValue()); assertThat(e.getApiSpecification(), notNullValue()); }); }
public <T> T read(String f, Class<T> classOfT) throws StageConfigNotFoundException, StageConfigFileInvalidFormatException, StageConfigFileIOException { try { final Reader reader = new FileReader(f); return read(reader, classOfT); } catch (JsonIOException e) { throw new StageConfigFileIOException(e.getMessage(), e); } catch (FileNotFoundException e) { throw new StageConfigNotFoundException(e.getMessage(), e); } catch (JsonSyntaxException e) { throw new StageConfigFileInvalidFormatException(e.getMessage(), e); } }
PublicationReader { public <T> T read(String f, Class<T> classOfT) throws StageConfigNotFoundException, StageConfigFileInvalidFormatException, StageConfigFileIOException { try { final Reader reader = new FileReader(f); return read(reader, classOfT); } catch (JsonIOException e) { throw new StageConfigFileIOException(e.getMessage(), e); } catch (FileNotFoundException e) { throw new StageConfigNotFoundException(e.getMessage(), e); } catch (JsonSyntaxException e) { throw new StageConfigFileInvalidFormatException(e.getMessage(), e); } } }
PublicationReader { public <T> T read(String f, Class<T> classOfT) throws StageConfigNotFoundException, StageConfigFileInvalidFormatException, StageConfigFileIOException { try { final Reader reader = new FileReader(f); return read(reader, classOfT); } catch (JsonIOException e) { throw new StageConfigFileIOException(e.getMessage(), e); } catch (FileNotFoundException e) { throw new StageConfigNotFoundException(e.getMessage(), e); } catch (JsonSyntaxException e) { throw new StageConfigFileInvalidFormatException(e.getMessage(), e); } }  }
PublicationReader { public <T> T read(String f, Class<T> classOfT) throws StageConfigNotFoundException, StageConfigFileInvalidFormatException, StageConfigFileIOException { try { final Reader reader = new FileReader(f); return read(reader, classOfT); } catch (JsonIOException e) { throw new StageConfigFileIOException(e.getMessage(), e); } catch (FileNotFoundException e) { throw new StageConfigNotFoundException(e.getMessage(), e); } catch (JsonSyntaxException e) { throw new StageConfigFileInvalidFormatException(e.getMessage(), e); } }  T read(String f, Class<T> classOfT); T read(Reader r, Class<T> classOfT); }
PublicationReader { public <T> T read(String f, Class<T> classOfT) throws StageConfigNotFoundException, StageConfigFileInvalidFormatException, StageConfigFileIOException { try { final Reader reader = new FileReader(f); return read(reader, classOfT); } catch (JsonIOException e) { throw new StageConfigFileIOException(e.getMessage(), e); } catch (FileNotFoundException e) { throw new StageConfigNotFoundException(e.getMessage(), e); } catch (JsonSyntaxException e) { throw new StageConfigFileInvalidFormatException(e.getMessage(), e); } }  T read(String f, Class<T> classOfT); T read(Reader r, Class<T> classOfT);  }