Migrate common/util to JUnit5
[yangtools.git] / common / util / src / test / java / org / opendaylight / yangtools / util / HashCodeBuilderTest.java
index 5c5be21eacad4646f44ebca6396f4248f6156c6b..e749e71e24c95adc74f9066a054ad31bb50b8b68 100644 (file)
@@ -7,20 +7,20 @@
  */
 package org.opendaylight.yangtools.util;
 
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 
-public class HashCodeBuilderTest {
+class HashCodeBuilderTest {
     @Test
-    public void testAllMethodsOfHashCodeBuilder() {
-        final HashCodeBuilder<String> builder = new HashCodeBuilder<>();
-        assertEquals("Default hash code should be '1'.", 1, builder.build());
+    void testAllMethodsOfHashCodeBuilder() {
+        final var builder = new HashCodeBuilder<>();
+        assertEquals(1, builder.build(), "Default hash code should be '1'.");
 
-        int nextHashCode = HashCodeBuilder.nextHashCode(1, "test");
-        assertEquals("Next hash code should be '3556529'.", 3556529, nextHashCode);
+        final var nextHashCode = HashCodeBuilder.nextHashCode(1, "test");
+        assertEquals(3556529, nextHashCode, "Next hash code should be '3556529'.");
 
         builder.addArgument("another test");
-        assertEquals("Updated internal hash code should be '700442706'.", -700442706, builder.build());
+        assertEquals(-700442706, builder.build(), "Updated internal hash code should be '700442706'.");
     }
 }