Unit tests for Request derived classes
[controller.git] / opendaylight / md-sal / cds-access-api / src / test / java / org / opendaylight / controller / cluster / access / commands / ExistsTransactionRequestTest.java
diff --git a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionRequestTest.java b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionRequestTest.java
new file mode 100644 (file)
index 0000000..d80525b
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * 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 class ExistsTransactionRequestTest extends AbstractReadTransactionRequestTest<ExistsTransactionRequest> {
+    private static final ExistsTransactionRequest OBJECT = new ExistsTransactionRequest(
+            TRANSACTION_IDENTIFIER, 0, ACTOR_REF, PATH, SNAPSHOT_ONLY);
+
+    @Override
+    protected ExistsTransactionRequest object() {
+        return OBJECT;
+    }
+
+    @Test
+    public void cloneAsVersion() throws Exception {
+        final ABIVersion cloneVersion = ABIVersion.TEST_FUTURE_VERSION;
+        final ExistsTransactionRequest clone = OBJECT.cloneAsVersion(cloneVersion);
+        Assert.assertEquals(cloneVersion, clone.getVersion());
+        Assert.assertEquals(OBJECT.getPath(), clone.getPath());
+        Assert.assertEquals(OBJECT.isSnapshotOnly(), clone.isSnapshotOnly());
+    }
+
+    @Test
+    public void externalizableProxy() throws Exception {
+        final ABIVersion proxyVersion = ABIVersion.TEST_FUTURE_VERSION;
+        final ExistsTransactionRequestProxyV1 proxy = OBJECT.externalizableProxy(proxyVersion);
+        Assert.assertNotNull(proxy);
+    }
+}
\ No newline at end of file