Fixed JUnit tests causing build issues due to mixing JUnit 4 & JUnit 5

This commit is contained in:
Toxic Dreamz
2020-08-19 23:14:37 +04:00
parent 6921b0dce0
commit 860453b46b
6 changed files with 52 additions and 52 deletions
@@ -23,24 +23,23 @@
package com.iluwatar.partialresponse;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* tests {@link FieldJsonMapper}.
*/
public class FieldJsonMapperTest {
private FieldJsonMapper mapper;
class FieldJsonMapperTest {
private static FieldJsonMapper mapper;
@Before
public void setUp() {
@BeforeAll
static void setUp() {
mapper = new FieldJsonMapper();
}
@Test
public void shouldReturnJsonForSpecifiedFieldsInVideo() throws Exception {
void shouldReturnJsonForSpecifiedFieldsInVideo() throws Exception {
var fields = new String[]{"id", "title", "length"};
var video = new Video(
2, "Godzilla Resurgence", 120,
@@ -50,6 +49,6 @@ public class FieldJsonMapperTest {
var jsonFieldResponse = mapper.toJson(video, fields);
var expectedDetails = "{\"id\": 2,\"title\": \"Godzilla Resurgence\",\"length\": 120}";
assertEquals(expectedDetails, jsonFieldResponse);
Assertions.assertEquals(expectedDetails, jsonFieldResponse);
}
}