Bug 5947: Increasing code coverage - mdsal-common-api
[mdsal.git] / common / mdsal-common-api / src / test / java / org / opendaylight / mdsal / common / api / PostCommitStepTest.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.common.api;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.opendaylight.mdsal.common.api.PostPreCommitStep.NOOP_COMMIT_FUTURE;
12
13 import org.junit.Test;
14
15 public class PostCommitStepTest {
16
17     @Test
18     public void preCommitTest() throws Exception {
19         final PostCanCommitStep postCanCommitStep = PostCanCommitStep.NOOP;
20
21         assertEquals(ThreePhaseCommitStep.NOOP_ABORT_FUTURE ,postCanCommitStep.abort());
22         assertEquals(PostPreCommitStep.NOOP_FUTURE, postCanCommitStep.preCommit());
23     }
24
25     @Test
26     public void canCommitTest() throws Exception {
27         final PostPreCommitStep postPreCommitStep = PostPreCommitStep.NOOP;
28
29         assertEquals(ThreePhaseCommitStep.NOOP_ABORT_FUTURE ,postPreCommitStep.abort());
30         assertEquals(NOOP_COMMIT_FUTURE, postPreCommitStep.commit());
31     }
32 }