Test coverage: bmp.spi.parser
[bgpcep.git] / bgp / bmp-spi / src / test / java / org / opendaylight / protocol / bmp / spi / parser / PeerDistinguisherUtilTest.java
index 43de7eddbd46cf1585f3a07a5bf2d49cc87e29fc..85a7f3fec2850e22c0d4735ee311a713a2ecc7e4 100644 (file)
@@ -9,9 +9,10 @@
 package org.opendaylight.protocol.bmp.spi.parser;
 
 import static org.junit.Assert.assertEquals;
-
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 import org.junit.Assert;
 import org.junit.Test;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bmp.message.rev150512.DistinguisherType;
@@ -67,4 +68,15 @@ public class PeerDistinguisherUtilTest {
         PeerDistinguisherUtil.serializePeerDistinguisher(dBuilder.build(), buffer);
         Assert.assertArrayEquals(DISTINGUISHER_TYPE2, buffer.array());
     }
+
+    @Test(expected=UnsupportedOperationException.class)
+    public void testPeerDistinguisherUtilPrivateConstructor() throws Throwable {
+        final Constructor<PeerDistinguisherUtil> c = PeerDistinguisherUtil.class.getDeclaredConstructor();
+        c.setAccessible(true);
+        try {
+            c.newInstance();
+        } catch (final InvocationTargetException e) {
+            throw e.getCause();
+        }
+    }
 }