Track skipped transactions
[controller.git] / opendaylight / md-sal / cds-access-api / src / test / java / org / opendaylight / controller / cluster / access / commands / SkipTransactionsRequestTest.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.access.commands;
9
10 import static org.hamcrest.CoreMatchers.instanceOf;
11 import static org.hamcrest.MatcherAssert.assertThat;
12 import static org.junit.Assert.assertEquals;
13
14 import com.google.common.primitives.UnsignedLong;
15 import java.util.List;
16 import org.junit.Test;
17 import org.opendaylight.controller.cluster.access.ABIVersion;
18
19 public class SkipTransactionsRequestTest extends AbstractTransactionRequestTest<SkipTransactionsRequest> {
20     private static final SkipTransactionsRequest OBJECT = new SkipTransactionsRequest(
21             TRANSACTION_IDENTIFIER, 0, ACTOR_REF, List.of(UnsignedLong.ONE));
22
23     @Override
24     protected SkipTransactionsRequest object() {
25         return OBJECT;
26     }
27
28     @Test
29     public void cloneAsVersionTest() {
30         final SkipTransactionsRequest clone = OBJECT.cloneAsVersion(ABIVersion.BORON);
31         assertEquals(OBJECT, clone);
32     }
33
34     @Override
35     protected void doAdditionalAssertions(final Object deserialize) {
36         assertThat(deserialize, instanceOf(SkipTransactionsRequest.class));
37         assertEquals(OBJECT.getReplyTo(), ((SkipTransactionsRequest) deserialize).getReplyTo());
38     }
39 }