issue 1500 - using Junit 5 and resolved a build issue

This commit is contained in:
Mahendran Mookkiah 2020-09-27 09:26:19 -04:00
parent a125879d15
commit ad435dd2fd
3 changed files with 5 additions and 11 deletions

View File

@ -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>

View File

@ -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();
}
};
}

View File

@ -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);
}
}