Promote ForeignShardThreePhaseCommitCohort to dom.spi
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / ForwardingDOMRpcResultTest.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.doReturn;
11 import static org.mockito.Mockito.verify;
12 import static org.mockito.MockitoAnnotations.initMocks;
13
14 import org.junit.Test;
15 import org.mockito.Mock;
16 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
17
18 public class ForwardingDOMRpcResultTest extends ForwardingDOMRpcResult {
19
20     @Mock(name = "domRpcResult")
21     private DOMRpcResult domRpcResult;
22
23     @Test
24     public void basicTest() throws Exception {
25         initMocks(this);
26
27         doReturn(null).when(domRpcResult).getErrors();
28         this.getErrors();
29         verify(domRpcResult).getErrors();
30
31         doReturn(null).when(domRpcResult).getResult();
32         this.getResult();
33         verify(domRpcResult).getResult();
34     }
35
36     @Override
37     protected DOMRpcResult delegate() {
38         return domRpcResult;
39     }
40 }