Migrate yang-data-impl to JUnit5
[yangtools.git] / data / yang-data-impl / src / test / java / org / opendaylight / yangtools / yang / data / impl / codec / BooleanCodecStringTest.java
index 0223e9e624f05a3168cf2003dd8349f96cd964b1..8c29bd26709e64a7d7afb05f22348872a191b36d 100644 (file)
@@ -7,9 +7,9 @@
  */
 package org.opendaylight.yangtools.yang.data.impl.codec;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.opendaylight.yangtools.yang.data.api.codec.BooleanCodec;
 import org.opendaylight.yangtools.yang.model.ri.type.BaseTypes;
 
@@ -18,25 +18,25 @@ import org.opendaylight.yangtools.yang.model.ri.type.BaseTypes;
  *
  * @author Thomas Pantelis
  */
-public class BooleanCodecStringTest {
+class BooleanCodecStringTest {
     @SuppressWarnings("unchecked")
     @Test
-    public void testSerialize() {
-        BooleanCodec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(),
+    void testSerialize() {
+        final var codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(),
             BooleanCodec.class);
 
-        assertEquals("serialize", "true", codec.serialize(Boolean.TRUE));
-        assertEquals("serialize", "false", codec.serialize(Boolean.FALSE));
+        assertEquals("true", codec.serialize(Boolean.TRUE), "serialize");
+        assertEquals("false", codec.serialize(Boolean.FALSE), "serialize");
     }
 
     @SuppressWarnings("unchecked")
     @Test
-    public void testDeserialize() {
-        BooleanCodec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(),
+    void testDeserialize() {
+        final var codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(),
             BooleanCodec.class);
 
-        assertEquals("deserialize", Boolean.TRUE, codec.deserialize("true"));
-        assertEquals("deserialize", Boolean.FALSE, codec.deserialize("false"));
+        assertEquals(Boolean.TRUE, codec.deserialize("true"), "deserialize");
+        assertEquals(Boolean.FALSE, codec.deserialize("false"), "deserialize");
         TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx(codec, "TRUE");
         TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx(codec, "FALSE");
         TypeDefinitionAwareCodecTestHelper.deserializeWithExpectedIllegalArgEx(codec, "foo");