2 * Copyright (c) 2016 Cisco Systems, Inc. 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.mdsal.dom.spi.store;
10 import static org.mockito.Mockito.doReturn;
11 import static org.mockito.Mockito.verify;
13 import org.junit.Test;
14 import org.junit.runner.RunWith;
15 import org.mockito.Mock;
16 import org.mockito.junit.MockitoJUnitRunner;
18 @RunWith(MockitoJUnitRunner.StrictStubs.class)
19 public class ForwardingDOMStoreThreePhaseCommitCohortTest extends ForwardingDOMStoreThreePhaseCommitCohort {
20 @Mock(name = "domStoreThreePhaseCommitCohort")
21 public DOMStoreThreePhaseCommitCohort domStoreThreePhaseCommitCohort;
24 public void basicTest() throws Exception {
25 doReturn(null).when(domStoreThreePhaseCommitCohort).canCommit();
27 verify(domStoreThreePhaseCommitCohort).canCommit();
29 doReturn(null).when(domStoreThreePhaseCommitCohort).preCommit();
31 verify(domStoreThreePhaseCommitCohort).preCommit();
33 doReturn(null).when(domStoreThreePhaseCommitCohort).commit();
35 verify(domStoreThreePhaseCommitCohort).commit();
37 doReturn(null).when(domStoreThreePhaseCommitCohort).abort();
39 verify(domStoreThreePhaseCommitCohort).abort();
43 protected DOMStoreThreePhaseCommitCohort delegate() {
44 return domStoreThreePhaseCommitCohort;