2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.access.commands;
10 import com.google.common.base.Optional;
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.controller.cluster.access.ABIVersion;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16 public class ReadTransactionSuccessNoDataTest extends AbstractTransactionSuccessTest<ReadTransactionSuccess> {
17 private static final ReadTransactionSuccess OBJECT = new ReadTransactionSuccess(
18 TRANSACTION_IDENTIFIER, 0, Optional.absent());
21 protected ReadTransactionSuccess object() {
26 public void getDataTest() throws Exception {
27 final Optional<NormalizedNode<?, ?>> result = OBJECT.getData();
28 Assert.assertFalse(result.isPresent());
32 public void cloneAsVersionTest() throws Exception {
33 final ReadTransactionSuccess clone = OBJECT.cloneAsVersion(ABIVersion.BORON);
34 Assert.assertEquals(OBJECT, clone);
38 protected void doAdditionalAssertions(Object deserialize) {
39 Assert.assertTrue(deserialize instanceof ReadTransactionSuccess);
40 Assert.assertEquals(OBJECT.getData(), ((ReadTransactionSuccess) deserialize).getData());