*/
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<ExistsTransactionSuccess> {
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