@Test public void testGetVersionString() throws IOException { assertThat(Utils.getVersionString(), startsWith("v")); }
public static String getVersionString() { if (versionString == null) { try { Properties properties = new Properties(); try (InputStream in = Utils.class.getResourceAsStream("/version.properties")) { properties.load(in); } versionString = "v" + properties.getProperty("build.version"); } catch (IOException e) { throw new UncheckedIOException(e.getMessage(), e); } } return versionString; }
Utils { public static String getVersionString() { if (versionString == null) { try { Properties properties = new Properties(); try (InputStream in = Utils.class.getResourceAsStream("/version.properties")) { properties.load(in); } versionString = "v" + properties.getProperty("build.version"); } catch (IOException e) { throw new UncheckedIOException(e.getMessage(), e); } } return versionString; } }
Utils { public static String getVersionString() { if (versionString == null) { try { Properties properties = new Properties(); try (InputStream in = Utils.class.getResourceAsStream("/version.properties")) { properties.load(in); } versionString = "v" + properties.getProperty("build.version"); } catch (IOException e) { throw new UncheckedIOException(e.getMessage(), e); } } return versionString; }  }
Utils { public static String getVersionString() { if (versionString == null) { try { Properties properties = new Properties(); try (InputStream in = Utils.class.getResourceAsStream("/version.properties")) { properties.load(in); } versionString = "v" + properties.getProperty("build.version"); } catch (IOException e) { throw new UncheckedIOException(e.getMessage(), e); } } return versionString; }  static String getVersionString(); }
Utils { public static String getVersionString() { if (versionString == null) { try { Properties properties = new Properties(); try (InputStream in = Utils.class.getResourceAsStream("/version.properties")) { properties.load(in); } versionString = "v" + properties.getProperty("build.version"); } catch (IOException e) { throw new UncheckedIOException(e.getMessage(), e); } } return versionString; }  static String getVersionString();  }