mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 04:59:24 +00:00
Fixed JUnit tests causing build issues due to mixing JUnit 4 & JUnit 5
This commit is contained in:
+9
-10
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user