*/
package org.opendaylight.yangtools.yang.model.ri.type;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Optional;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.opendaylight.yangtools.yang.model.api.Status;
-import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.TypeDefinitions;
-public class BinaryTypeTest {
+class BinaryTypeTest {
@Test
- public void canCreateBinaryType() {
- final BinaryTypeDefinition binType = BaseTypes.binaryType();
- final BinaryTypeDefinition binType1 = BaseTypes.binaryType();
+ void canCreateBinaryType() {
+ final var binType = BaseTypes.binaryType();
+ final var binType1 = BaseTypes.binaryType();
- assertFalse(binType.getLengthConstraint().isPresent());
+ assertEquals(Optional.empty(), binType.getLengthConstraint());
assertEquals(Optional.empty(), binType.getDefaultValue());
- assertEquals("CURRENT", Status.CURRENT, binType.getStatus());
- assertEquals("Base type is null", null, binType.getBaseType());
- assertEquals("getQName gives BINARY_QNAME", TypeDefinitions.BINARY, binType.getQName());
+ assertEquals(Status.CURRENT, binType.getStatus(), "CURRENT");
+ assertNull(binType.getBaseType(), "Base type is null");
+ assertEquals(TypeDefinitions.BINARY, binType.getQName(), "getQName gives BINARY_QNAME");
assertEquals(Optional.empty(), binType.getUnits());
- assertTrue("binType1 should equal to binType", binType.equals(binType1) && binType1.equals(binType));
- assertTrue("Hash code of binType and binType1 should be equal",
- binType.hashCode() == binType1.hashCode());
- assertEquals("binType should equals to itself", binType, binType);
- assertFalse("binType shouldn't equal to null", binType.equals(null));
- assertFalse("binType shouldn't equal to object of other type", binType.equals("str"));
+ assertTrue(binType.equals(binType1) && binType1.equals(binType), "binType1 should equal to binType");
+ assertEquals(binType.hashCode(), binType1.hashCode(), "Hash code of binType and binType1 should be equal");
+ assertEquals(binType, binType, "binType should equals to itself");
+ assertNotEquals(null, binType, "binType shouldn't equal to null");
+ assertNotEquals("str", binType, "binType shouldn't equal to object of other type");
}
}