Skip to content

Commit f006782

Browse files
authored
Merge pull request iluwatar#1529 from mookkiah/issue_1500
issue 1500 - using JUnit 5 and resolved a build issue
2 parents 1f4a412 + ad435dd commit f006782

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

trampoline/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
</parent>
3636
<artifactId>trampoline</artifactId>
3737
<dependencies>
38-
<dependency>
39-
<groupId>junit</groupId>
40-
<artifactId>junit</artifactId>
41-
<scope>test</scope>
42-
</dependency>
4338

4439
<dependency>
4540
<groupId>org.junit.jupiter</groupId>

trampoline/src/main/java/com/iluwatar/trampoline/Trampoline.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ public T get() {
9898
return trampoline(this);
9999
}
100100

101-
T trampoline(final Trampoline<T> trampoline) {
101+
private T trampoline(final Trampoline<T> trampoline) {
102102
return Stream.iterate(trampoline, Trampoline::jump)
103103
.filter(Trampoline::complete)
104104
.findFirst()
105105
.map(Trampoline::result)
106-
.orElseThrow();
106+
.get();
107107
}
108108
};
109109
}

trampoline/src/test/java/com/iluwatar/trampoline/TrampolineAppTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323

2424
package com.iluwatar.trampoline;
2525

26-
import static org.junit.Assert.assertEquals;
27-
28-
import org.junit.Test;
26+
import static org.junit.jupiter.api.Assertions.assertEquals;
2927

28+
import org.junit.jupiter.api.Test;
3029

3130
/**
3231
* Test for trampoline pattern.
@@ -37,7 +36,7 @@ public class TrampolineAppTest {
3736
@Test
3837
public void testTrampolineWithFactorialFunction() {
3938
long result = TrampolineApp.loop(10, 1).result();
40-
assertEquals("Be equal", 3628800, result);
39+
assertEquals(3_628_800, result);
4140
}
4241

4342
}

0 commit comments

Comments
 (0)