Migrate common to junit5 (#11431) (#11438)

Motivation:

We should update to use junit5 in all modules.

Modifications:

Adjust common tests to use junit5

Result:

Part of https://github.com/netty/netty/issues/10757
This commit is contained in:
Norman Maurer 2021-07-01 18:19:44 +02:00
parent 5dc238341a
commit 26a0efcb93

View File

@ -15,8 +15,9 @@
package io.netty.util.collection;
import io.netty.util.collection.@K@ObjectMap.PrimitiveEntry;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.HashMap;
@ -26,7 +27,13 @@ import java.util.Map;
import java.util.Random;
import java.util.Set;
import static org.junit.Assert.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Tests for {@link @K@ObjectHashMap}.
@ -73,13 +80,13 @@ public class @K@ObjectHashMapTest {
private @K@ObjectHashMap<Value> map;
@Before
@BeforeEach
public void setup() {
map = new @K@ObjectHashMap<Value>();
}
@Test
public void iteartorRemoveShouldNotNPE() {
public void iteratorRemoveShouldNotNPE() {
map = new @K@ObjectHashMap<Value>(4, 1);
map.put((@O@)(@k@) 0, new Value("A"));
map.put((@O@)(@k@) 1, new Value("B"));