X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fcommands%2FExistsTransactionSuccessTest.java;h=f7777b3049963d5d0c6d09c4eb93cb1b92f47d49;hb=e085f22bb1934959f9d6f7f4368c1afe964b1e07;hp=027613f93d701890144fdc306c55cd24da12fa56;hpb=2e84511f911d19570cd4e8d1462f8394479c72d8;p=controller.git diff --git a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionSuccessTest.java b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionSuccessTest.java index 027613f93d..f7777b3049 100644 --- a/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionSuccessTest.java +++ b/opendaylight/md-sal/cds-access-api/src/test/java/org/opendaylight/controller/cluster/access/commands/ExistsTransactionSuccessTest.java @@ -7,38 +7,42 @@ */ package org.opendaylight.controller.cluster.access.commands; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; + import com.google.common.base.MoreObjects; -import org.junit.Assert; import org.junit.Test; import org.opendaylight.controller.cluster.access.ABIVersion; public class ExistsTransactionSuccessTest extends AbstractTransactionSuccessTest { private static final boolean EXISTS = true; - private static final ExistsTransactionSuccess OBJECT = new ExistsTransactionSuccess( - TRANSACTION_IDENTIFIER, 0, EXISTS); + private static final ExistsTransactionSuccess OBJECT = new ExistsTransactionSuccess(TRANSACTION_IDENTIFIER, 0, + EXISTS); - @Test - public void getExists() throws Exception { - final boolean result = OBJECT.getExists(); - Assert.assertEquals(EXISTS, result); + public ExistsTransactionSuccessTest() { + super(OBJECT, 487); } @Test - public void externalizableProxy() throws Exception { - final ExistsTransactionSuccessProxyV1 proxy = OBJECT.externalizableProxy(ABIVersion.BORON); - Assert.assertNotNull(proxy); + public void getExistsTest() { + assertEquals(EXISTS, OBJECT.getExists()); } @Test - public void cloneAsVersion() throws Exception { - final ExistsTransactionSuccess clone = OBJECT.cloneAsVersion(ABIVersion.BORON); - Assert.assertEquals(OBJECT, clone); + public void cloneAsVersionTest() { + assertEquals(OBJECT, OBJECT.cloneAsVersion(ABIVersion.BORON)); } @Test - public void addToStringAttributes() throws Exception { - final MoreObjects.ToStringHelper result = OBJECT.addToStringAttributes(MoreObjects.toStringHelper(OBJECT)); - Assert.assertTrue(result.toString().contains("exists=" + EXISTS)); + public void addToStringAttributesTest() { + final var result = OBJECT.addToStringAttributes(MoreObjects.toStringHelper(OBJECT)).toString(); + assertThat(result, containsString("exists=" + EXISTS)); + } + + @Override + protected void doAdditionalAssertions(final ExistsTransactionSuccess deserialize) { + assertEquals(OBJECT.getExists(), deserialize.getExists()); } } \ No newline at end of file