Clean up mdsal-binding-util test
[mdsal.git] / binding / mdsal-binding-util / src / test / java / org / opendaylight / mdsal / binding / util / DatastoreTest.java
index 8e1976e2dce278d34113b8869c18e006d9576ed6..1cd953bc30cc4ae71511d4b79f8bca69a69e3b51 100644 (file)
@@ -7,33 +7,24 @@
  */
 package org.opendaylight.mdsal.binding.util;
 
-import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThrows;
 
-import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 
 public class DatastoreTest {
-
     @Test
-    public void testDatastore() {
-        assertThat(Datastore.toType(Datastore.CONFIGURATION)).isEqualTo(LogicalDatastoreType.CONFIGURATION);
-        assertThat(Datastore.toType(Datastore.OPERATIONAL)).isEqualTo(LogicalDatastoreType.OPERATIONAL);
-        try {
-            Datastore.toType(null);
-            Assert.fail("Expected Datastore.toType(null) to throw NullPointerException");
-        } catch (NullPointerException e) {
-            // OK, this is what we're expecting
-        }
-
-        assertThat(Datastore.toClass(LogicalDatastoreType.CONFIGURATION)).isEqualTo(Datastore.CONFIGURATION);
-        assertThat(Datastore.toClass(LogicalDatastoreType.OPERATIONAL)).isEqualTo(Datastore.OPERATIONAL);
-        try {
-            Datastore.toClass(null);
-            Assert.fail("Expected Datastore.toClass(null) to throw NullPointerException");
-        } catch (NullPointerException e) {
-            // OK, this is what we're expecting
-        }
+    public void testDatastoreToType() {
+        assertEquals(LogicalDatastoreType.CONFIGURATION, Datastore.toType(Datastore.CONFIGURATION));
+        assertEquals(LogicalDatastoreType.OPERATIONAL, Datastore.toType(Datastore.OPERATIONAL));
+        assertThrows(NullPointerException.class, () -> Datastore.toType(null));
     }
 
+    @Test
+    public void testDatastoreToClass() {
+        assertEquals(Datastore.CONFIGURATION, Datastore.toClass(LogicalDatastoreType.CONFIGURATION));
+        assertEquals(Datastore.OPERATIONAL, Datastore.toClass(LogicalDatastoreType.OPERATIONAL));
+        assertThrows(NullPointerException.class, () -> Datastore.toClass(null));
+    }
 }