Bump odlparent/yangtools/mdsal
[controller.git] / opendaylight / md-sal / cds-access-api / src / test / java / org / opendaylight / controller / cluster / access / commands / ReadTransactionSuccessNoDataTest.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies 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.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13
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;
18
19 public class ReadTransactionSuccessNoDataTest extends AbstractTransactionSuccessTest<ReadTransactionSuccess> {
20     private static final ReadTransactionSuccess OBJECT = new ReadTransactionSuccess(
21             TRANSACTION_IDENTIFIER, 0, Optional.empty());
22
23     @Override
24     protected ReadTransactionSuccess object() {
25         return OBJECT;
26     }
27
28     @Test
29     public void getDataTest() {
30         final Optional<NormalizedNode> result = OBJECT.getData();
31         assertFalse(result.isPresent());
32     }
33
34     @Test
35     public void cloneAsVersionTest() {
36         final ReadTransactionSuccess clone = OBJECT.cloneAsVersion(ABIVersion.BORON);
37         assertEquals(OBJECT, clone);
38     }
39
40     @Override
41     protected void doAdditionalAssertions(final Object deserialize) {
42         assertTrue(deserialize instanceof ReadTransactionSuccess);
43         assertEquals(OBJECT.getData(), ((ReadTransactionSuccess) deserialize).getData());
44     }
45 }