issue 1500 - using Junit 5 and resolved a build issue
This commit is contained in:
parent
a125879d15
commit
ad435dd2fd
@ -35,11 +35,6 @@
|
||||
</parent>
|
||||
<artifactId>trampoline</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
|
@ -98,12 +98,12 @@ public interface Trampoline<T> {
|
||||
return trampoline(this);
|
||||
}
|
||||
|
||||
T trampoline(final Trampoline<T> trampoline) {
|
||||
private T trampoline(final Trampoline<T> trampoline) {
|
||||
return Stream.iterate(trampoline, Trampoline::jump)
|
||||
.filter(Trampoline::complete)
|
||||
.findFirst()
|
||||
.map(Trampoline::result)
|
||||
.orElseThrow();
|
||||
.get();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -23,10 +23,9 @@
|
||||
|
||||
package com.iluwatar.trampoline;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* Test for trampoline pattern.
|
||||
@ -37,7 +36,7 @@ public class TrampolineAppTest {
|
||||
@Test
|
||||
public void testTrampolineWithFactorialFunction() {
|
||||
long result = TrampolineApp.loop(10, 1).result();
|
||||
assertEquals("Be equal", 3628800, result);
|
||||
assertEquals(3_628_800, result);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user