Update to JUnit5 across all modules (#1668)

* Updated saga to JUnit 5

* Update fix for CI job in trampoline module

* Updated update-method module to JUnit 5

* Upgraded to latest JUnit Jupiter
JUnit 4 is not needed when using JUnit-Vintage

* Reverted change to access modifier on Trampoline

* Cleanup to resolve code smells

* Formatting

* Formatting

* Migrating to JUnit5 and updating some Mockito patterns

* Migrating to JUnit5

* Migrating to JUnit5

* Migrating to JUnit 5

* Formatting cleanup

* Added missing scope for junit

* Fixed tests that were not running previously.

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
This commit is contained in:
CF
2021-03-06 04:12:46 -05:00
committed by GitHub
parent e9d0b3e98c
commit c150871a94
53 changed files with 333 additions and 412 deletions

View File

@ -34,12 +34,6 @@
<artifactId>combinator</artifactId>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>

View File

@ -23,11 +23,11 @@
package com.iluwatar.combinator;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
public class CombinatorAppTest {
import org.junit.jupiter.api.Test;
class CombinatorAppTest {
/**
* Issue: Add at least one assertion to this test case.
@ -37,7 +37,7 @@ public class CombinatorAppTest {
*/
@Test
public void shouldExecuteApplicationWithoutException() {
void shouldExecuteApplicationWithoutException() {
assertDoesNotThrow(() -> CombinatorApp.main(new String[]{}));
}
}
}

View File

@ -23,22 +23,19 @@
package com.iluwatar.combinator;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.List;
import org.junit.jupiter.api.Test;
import static org.junit.Assert.*;
public class FinderTest {
class FinderTest {
@Test
public void contains() {
void contains() {
var example = "the first one \nthe second one \n";
var result = Finder.contains("second").find(example);
Assert.assertEquals(result.size(),1);
Assert.assertEquals(result.get(0),"the second one ");
assertEquals(1, result.size());
assertEquals("the second one ", result.get(0));
}
}
}

View File

@ -23,44 +23,44 @@
package com.iluwatar.combinator;
import org.junit.Assert;
import org.junit.Test;
import static com.iluwatar.combinator.Finders.advancedFinder;
import static com.iluwatar.combinator.Finders.expandedFinder;
import static com.iluwatar.combinator.Finders.filteredFinder;
import static com.iluwatar.combinator.Finders.specializedFinder;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.List;
import org.junit.jupiter.api.Test;
import static com.iluwatar.combinator.Finders.*;
import static org.junit.Assert.*;
public class FindersTest {
class FindersTest {
@Test
public void advancedFinderTest() {
void advancedFinderTest() {
var res = advancedFinder("it was","kingdom","sea").find(text());
Assert.assertEquals(res.size(),1);
Assert.assertEquals(res.get(0),"It was many and many a year ago,");
assertEquals(1, res.size());
assertEquals("It was many and many a year ago,", res.get(0));
}
@Test
public void filteredFinderTest() {
void filteredFinderTest() {
var res = filteredFinder(" was ", "many", "child").find(text());
Assert.assertEquals(res.size(),1);
Assert.assertEquals(res.get(0),"But we loved with a love that was more than love-");
assertEquals(1, res.size());
assertEquals("But we loved with a love that was more than love-", res.get(0));
}
@Test
public void specializedFinderTest() {
void specializedFinderTest() {
var res = specializedFinder("love","heaven").find(text());
Assert.assertEquals(res.size(),1);
Assert.assertEquals(res.get(0),"With a love that the winged seraphs of heaven");
assertEquals(1, res.size());
assertEquals("With a love that the winged seraphs of heaven", res.get(0));
}
@Test
public void expandedFinderTest() {
void expandedFinderTest() {
var res = expandedFinder("It was","kingdom").find(text());
Assert.assertEquals(res.size(),3);
Assert.assertEquals(res.get(0),"It was many and many a year ago,");
Assert.assertEquals(res.get(1),"In a kingdom by the sea,");
Assert.assertEquals(res.get(2),"In this kingdom by the sea;");
assertEquals(3, res.size());
assertEquals("It was many and many a year ago,", res.get(0));
assertEquals("In a kingdom by the sea,", res.get(1));
assertEquals("In this kingdom by the sea;", res.get(2));
}
@ -80,4 +80,4 @@ public class FindersTest {
+ "Coveted her and me.";
}
}
}