@Test public final void testGetProjectInfo() throws FailedToLoadProjectInfoException { final ProjectInfo projectInfo = Utils.getProjectInfo(Utils.class, "/auction-common.properties"); assertThat(projectInfo.getName()).isEqualTo("Axon Auction Example - Common"); assertThat(projectInfo.getVersion()).isNotEmpty(); assertThat(projectInfo.getBuildTimestamp()).isNotNull(); }
public static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename) throws FailedToLoadProjectInfoException { try { return new ProjectInfo(loadProperties(clasz, propertiesFilename)); } catch (final IOException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, new IOException( "Resource '" + propertiesFilename + "' not found!")); } catch (final RuntimeException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, ex); } }
Utils { public static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename) throws FailedToLoadProjectInfoException { try { return new ProjectInfo(loadProperties(clasz, propertiesFilename)); } catch (final IOException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, new IOException( "Resource '" + propertiesFilename + "' not found!")); } catch (final RuntimeException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, ex); } } }
Utils { public static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename) throws FailedToLoadProjectInfoException { try { return new ProjectInfo(loadProperties(clasz, propertiesFilename)); } catch (final IOException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, new IOException( "Resource '" + propertiesFilename + "' not found!")); } catch (final RuntimeException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, ex); } } private  Utils(); }
Utils { public static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename) throws FailedToLoadProjectInfoException { try { return new ProjectInfo(loadProperties(clasz, propertiesFilename)); } catch (final IOException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, new IOException( "Resource '" + propertiesFilename + "' not found!")); } catch (final RuntimeException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, ex); } } private  Utils(); static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename); static Properties loadProperties(final Class<?> clasz, final String propertiesFilename); static String createMessage(final Exception ex); }
Utils { public static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename) throws FailedToLoadProjectInfoException { try { return new ProjectInfo(loadProperties(clasz, propertiesFilename)); } catch (final IOException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, new IOException( "Resource '" + propertiesFilename + "' not found!")); } catch (final RuntimeException ex) { throw new FailedToLoadProjectInfoException(clasz, propertiesFilename, ex); } } private  Utils(); static ProjectInfo getProjectInfo(final Class<?> clasz, final String propertiesFilename); static Properties loadProperties(final Class<?> clasz, final String propertiesFilename); static String createMessage(final Exception ex);  }