Bug 7271: Modify AbstractDOMStoreTreeChangePublisher to batch candidates
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMDataReadOnlyTransactionTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.mdsal.dom.spi;
9
10 import static org.mockito.Mockito.doNothing;
11 import static org.mockito.Mockito.doReturn;
12 import static org.mockito.Mockito.verify;
13 import static org.mockito.MockitoAnnotations.initMocks;
14
15 import javax.annotation.Nonnull;
16 import org.junit.Test;
17 import org.mockito.Mock;
18 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
19
20 public class ForwardingDOMDataReadOnlyTransactionTest extends ForwardingDOMDataReadOnlyTransaction {
21
22     @Mock(name = "domDataTreeReadTransaction")
23     private DOMDataTreeReadTransaction domDataTreeReadTransaction;
24
25     @Test
26     public void basicTest() throws Exception {
27         initMocks(this);
28
29         doReturn(null).when(domDataTreeReadTransaction).read(null, null);
30         this.read(null, null);
31         verify(domDataTreeReadTransaction).read(null, null);
32
33         doReturn(null).when(domDataTreeReadTransaction).exists(null, null);
34         this.exists(null, null);
35         verify(domDataTreeReadTransaction).exists(null, null);
36
37         doReturn(null).when(domDataTreeReadTransaction).getIdentifier();
38         this.getIdentifier();
39         verify(domDataTreeReadTransaction).getIdentifier();
40
41         doNothing().when(domDataTreeReadTransaction).close();
42         this.close();
43         verify(domDataTreeReadTransaction).close();
44     }
45
46     @Nonnull
47     @Override
48     protected DOMDataTreeReadTransaction delegate() {
49         return domDataTreeReadTransaction;
50     }
51 }