Convert mdsal-dom-spi to a JPMS module
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / store / ForwardingDOMStoreThreePhaseCommitCohortTest.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.store;
9
10 import static org.mockito.Mockito.doReturn;
11 import static org.mockito.Mockito.verify;
12
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.mockito.Mock;
16 import org.mockito.junit.MockitoJUnitRunner;
17
18 @RunWith(MockitoJUnitRunner.StrictStubs.class)
19 public class ForwardingDOMStoreThreePhaseCommitCohortTest extends ForwardingDOMStoreThreePhaseCommitCohort {
20     @Mock(name = "domStoreThreePhaseCommitCohort")
21     public DOMStoreThreePhaseCommitCohort domStoreThreePhaseCommitCohort;
22
23     @Test
24     public void basicTest() throws Exception {
25         doReturn(null).when(domStoreThreePhaseCommitCohort).canCommit();
26         this.canCommit();
27         verify(domStoreThreePhaseCommitCohort).canCommit();
28
29         doReturn(null).when(domStoreThreePhaseCommitCohort).preCommit();
30         this.preCommit();
31         verify(domStoreThreePhaseCommitCohort).preCommit();
32
33         doReturn(null).when(domStoreThreePhaseCommitCohort).commit();
34         this.commit();
35         verify(domStoreThreePhaseCommitCohort).commit();
36
37         doReturn(null).when(domStoreThreePhaseCommitCohort).abort();
38         this.abort();
39         verify(domStoreThreePhaseCommitCohort).abort();
40     }
41
42     @Override
43     protected DOMStoreThreePhaseCommitCohort delegate() {
44         return domStoreThreePhaseCommitCohort;
45     }
46 }