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

@ -35,12 +35,6 @@
<artifactId>partial-response</artifactId>
<dependencies>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>

View File

@ -23,17 +23,18 @@
package com.iluwatar.partialresponse;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import java.util.Map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import java.util.Map;
/**
* tests {@link VideoResource}.
*/
@ -44,8 +45,8 @@ class VideoResourceTest {
private static VideoResource resource;
@BeforeAll
static void setUp() {
@BeforeEach
void setUp() {
var videos = Map.of(
1, new Video(1, "Avatar", 178, "epic science fiction film",
"James Cameron", "English"),
@ -70,7 +71,7 @@ class VideoResourceTest {
var fields = new String[]{"id", "title", "length"};
var expectedDetails = "{\"id\": 1,\"title\": \"Avatar\",\"length\": 178}";
Mockito.when(fieldJsonMapper.toJson(Matchers.any(Video.class), Matchers.eq(fields))).thenReturn(expectedDetails);
Mockito.when(fieldJsonMapper.toJson(any(Video.class), eq(fields))).thenReturn(expectedDetails);
var actualFieldsDetails = resource.getDetails(2, fields);