Clean up mdsal-binding-util test
[mdsal.git] / binding / mdsal-binding-util / src / test / java / org / opendaylight / mdsal / binding / util / DatastoreTest.java
1 /*
2  * Copyright (c) 2018 Red Hat, Inc. and others. All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.mdsal.binding.util;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertThrows;
12
13 import org.junit.Test;
14 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
15
16 public class DatastoreTest {
17     @Test
18     public void testDatastoreToType() {
19         assertEquals(LogicalDatastoreType.CONFIGURATION, Datastore.toType(Datastore.CONFIGURATION));
20         assertEquals(LogicalDatastoreType.OPERATIONAL, Datastore.toType(Datastore.OPERATIONAL));
21         assertThrows(NullPointerException.class, () -> Datastore.toType(null));
22     }
23
24     @Test
25     public void testDatastoreToClass() {
26         assertEquals(Datastore.CONFIGURATION, Datastore.toClass(LogicalDatastoreType.CONFIGURATION));
27         assertEquals(Datastore.OPERATIONAL, Datastore.toClass(LogicalDatastoreType.OPERATIONAL));
28         assertThrows(NullPointerException.class, () -> Datastore.toClass(null));
29     }
30 }