Skip to content

Commit 5b32613

Browse files
committed
EVCSBranchExists refactored
1 parent 899321b commit 5b32613

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/main/java/org/scm4j/vcs/api/exceptions/EVCSBranchExists.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class EVCSBranchExists extends EVCSException {
44

55
private static final long serialVersionUID = 1806733612822322930L;
66

7-
public EVCSBranchExists(Exception e) {
8-
super(e);
7+
public EVCSBranchExists(String branchName) {
8+
super("branch already exists: " + branchName);
99
}
1010
}

src/test/java/org/scm4j/vcs/api/exceptions/ExceptionsTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ public void testEVCSException() {
2121

2222
@Test
2323
public void testEVCSBranchExists() {
24-
Exception e = new Exception(TEST_MESSAGE);
25-
EVCSBranchExists e1 = new EVCSBranchExists(e);
26-
assertTrue(e1.getMessage().contains(TEST_MESSAGE));
27-
assertEquals(e1.getCause(), e);
24+
EVCSBranchExists e = new EVCSBranchExists(TEST_BRANCH_NAME);
25+
assertTrue(e.getMessage().contains(TEST_BRANCH_NAME));
2826
}
2927

3028
@Test

0 commit comments

Comments
 (0)