Skip to content

Commit e72afd3

Browse files
committed
tests updated
1 parent 54b3407 commit e72afd3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/java/org/scm4j/vcs/svn/SVNVCS.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public List<VCSDiffEntry> getBranchesDiff(final String srcBranchName, final Stri
414414
public Set<String> getBranches(String path) {
415415
try {
416416
List<String> entries = new ArrayList<>();
417-
listEntries(entries, SVNVCS.BRANCHES_PATH, path);
417+
listEntries(entries, SVNVCS.BRANCHES_PATH, path == null ? "" : path);
418418
Set<String> res = new HashSet<>(entries);
419419
addTrunkIfExists(res);
420420
return res;
@@ -706,6 +706,7 @@ public VCSTag getLastTag() {
706706
@Override
707707
public void removeTag(String tagName) {
708708
try {
709+
getBranchUrl(null); // for test exceptions throwing only
709710
clientManager
710711
.getCommitClient()
711712
.doDelete(new SVNURL[] { SVNURL.parseURIEncoded(repoUrl + TAGS_PATH + tagName) }, null);

src/test/java/org/scm4j/vcs/svn/SVNVCSTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,4 +425,12 @@ public void testRevToSVNEntryNull() throws Exception {
425425
public void testSVNVCSUtilsCreation() {
426426
assertNotNull(new SVNVCSUtils());
427427
}
428+
429+
@Test
430+
public void testListEntriesNone() throws Exception {
431+
SVNRepository mockedRepo = spy(svn.getSVNRepository());
432+
svn.setSVNRepository(mockedRepo);
433+
doReturn(SVNNodeKind.NONE).when(mockedRepo).checkPath(anyString(), anyLong());
434+
svn.listEntries(null, null, null); // expecting no NPE
435+
}
428436
}

0 commit comments

Comments
 (0)