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 static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
14 import java.util.Optional;
15 import org.junit.Test;
16 import org.opendaylight.controller.cluster.access.ABIVersion;
17 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 public class ReadTransactionSuccessNoDataTest extends AbstractTransactionSuccessTest<ReadTransactionSuccess> {
20 private static final ReadTransactionSuccess OBJECT = new ReadTransactionSuccess(
21 TRANSACTION_IDENTIFIER, 0, Optional.empty());
24 protected ReadTransactionSuccess object() {
29 public void getDataTest() {
30 final Optional<NormalizedNode> result = OBJECT.getData();
31 assertFalse(result.isPresent());
35 public void cloneAsVersionTest() {
36 final ReadTransactionSuccess clone = OBJECT.cloneAsVersion(ABIVersion.BORON);
37 assertEquals(OBJECT, clone);
41 protected void doAdditionalAssertions(final Object deserialize) {
42 assertTrue(deserialize instanceof ReadTransactionSuccess);
43 assertEquals(OBJECT.getData(), ((ReadTransactionSuccess) deserialize).getData());