@Test public void When_CheckExtensionIsCalled_Expect_CorrectStringReturned() { assertThat(stringMethods.checkExtension(TEST_PATH), is("/test_path/file_name.ncf")); assertThat(stringMethods.checkExtension(".ncf"), is(".ncf")); }
public String checkExtension(final String path) { if (path.equals("") || path.length() < EXTENSION.length() || !path.substring(path.length() - EXTENSION.length(), path.length()).equals(EXTENSION)) { return path + EXTENSION; } return path; }
StringMethods { public String checkExtension(final String path) { if (path.equals("") || path.length() < EXTENSION.length() || !path.substring(path.length() - EXTENSION.length(), path.length()).equals(EXTENSION)) { return path + EXTENSION; } return path; } }
StringMethods { public String checkExtension(final String path) { if (path.equals("") || path.length() < EXTENSION.length() || !path.substring(path.length() - EXTENSION.length(), path.length()).equals(EXTENSION)) { return path + EXTENSION; } return path; } private  StringMethods(); }
StringMethods { public String checkExtension(final String path) { if (path.equals("") || path.length() < EXTENSION.length() || !path.substring(path.length() - EXTENSION.length(), path.length()).equals(EXTENSION)) { return path + EXTENSION; } return path; } private  StringMethods(); static StringMethods getInstance(); String fixPath(final String path); String checkExtension(final String path); String getNameDB(final String path); static boolean containsIgnoreCase(String str, String searchStr); }
StringMethods { public String checkExtension(final String path) { if (path.equals("") || path.length() < EXTENSION.length() || !path.substring(path.length() - EXTENSION.length(), path.length()).equals(EXTENSION)) { return path + EXTENSION; } return path; } private  StringMethods(); static StringMethods getInstance(); String fixPath(final String path); String checkExtension(final String path); String getNameDB(final String path); static boolean containsIgnoreCase(String str, String searchStr); static final String DEFAULT_FOLDER; }