Skip to content

Commit 543a5ba

Browse files
committed
Fix Junit 4 tests to use JUnit 5
1 parent 28770b9 commit 543a5ba

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/deser/InstantDeser291Test.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.time.Instant;
44
import java.util.Locale;
55

6-
import org.junit.Test;
6+
import org.junit.jupiter.api.Test;
77

88
import com.fasterxml.jackson.core.json.JsonReadFeature;
99
import com.fasterxml.jackson.databind.ObjectReader;
@@ -13,8 +13,7 @@
1313
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
1414
import com.fasterxml.jackson.datatype.jsr310.ModuleTestBase;
1515

16-
import static org.junit.Assert.assertEquals;
17-
import static org.junit.Assert.assertThrows;
16+
import static org.junit.jupiter.api.Assertions.*;
1817

1918
// [modules-java8#291] InstantDeserializer fails to parse negative numeric timestamp strings for
2019
// pre-1970 values.

datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/deser/OffsetTimeDeserTest.java

+3-16
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ public void testDeserializationFromString01() throws Exception
194194
value = READER.readValue('"' + time.toString() + '"');
195195
assertEquals(time, value, "The value is not correct.");
196196

197-
expectSuccess(OffsetTime.of(12, 0, 0, 0, ZoneOffset.UTC), "'12:00Z'");
197+
assertEquals(OffsetTime.of(12, 0, 0, 0, ZoneOffset.UTC),
198+
read("'12:00Z'"));
198199
}
199200

200201
@Test
@@ -286,7 +287,7 @@ public void testDeserializationAsArrayEnabled() throws Throwable
286287
{
287288
OffsetTime value = READER.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
288289
.readValue(a2q("['12:00Z']"));
289-
expect(OffsetTime.of(12, 0, 0, 0, ZoneOffset.UTC), value);
290+
assertEquals(OffsetTime.of(12, 0, 0, 0, ZoneOffset.UTC), value);
290291
}
291292

292293
@Test
@@ -354,21 +355,7 @@ private void expectFailure(String json) throws Throwable {
354355
}
355356
}
356357

357-
private void expectSuccess(Object exp, String json) throws IOException {
358-
final OffsetTime value = read(json);
359-
assertNotNull(value, "The value should not be null.");
360-
assertEquals(exp, value, "The value is not correct.");
361-
}
362-
363358
private OffsetTime read(final String json) throws IOException {
364359
return READER.readValue(a2q(json));
365360
}
366-
367-
private static void notNull(Object value) {
368-
assertNotNull(value, "The value should not be null.");
369-
}
370-
371-
private static void expect(Object exp, Object value) {
372-
assertEquals(exp, value, "The value is not correct.");
373-
}
374361
}

0 commit comments

Comments
 (0)