Unit tests for Request derived classes
[controller.git] / opendaylight / md-sal / cds-access-api / src / test / java / org / opendaylight / controller / cluster / access / commands / AbstractLocalTransactionRequestTest.java
diff --git a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/AbstractLocalTransactionRequestTest.java b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/AbstractLocalTransactionRequestTest.java
new file mode 100644 (file)
index 0000000..33cba17
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.access.commands;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.opendaylight.controller.cluster.access.ABIVersion;
+
+public abstract class AbstractLocalTransactionRequestTest<T extends AbstractLocalTransactionRequest>
+        extends AbstractTransactionRequestTest {
+    @Override
+    protected abstract T object();
+
+    @Test(expected = UnsupportedOperationException.class)
+    public void testExternalizableProxy() {
+        object().externalizableProxy(ABIVersion.BORON);
+    }
+
+    @Test
+    public void cloneAsVersionTest() {
+        Assert.assertEquals(object(), object().cloneAsVersion(ABIVersion.BORON));
+    }
+}