Move AbstractDOMDataBroker to mdsal-dom-spi
[mdsal.git] / dom / mdsal-dom-spi / src / test / java / org / opendaylight / mdsal / dom / spi / TransactionCommitFailedExceptionMapperTest.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.junit.jupiter.api.Assertions.assertInstanceOf;
11 import static org.junit.jupiter.api.Assertions.assertSame;
12
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
15
16 class TransactionCommitFailedExceptionMapperTest {
17     private final TransactionCommitFailedExceptionMapper mapper = TransactionCommitFailedExceptionMapper.create("test");
18
19     @Test
20     void create() {
21         final var cause = new Throwable();
22         final var ex = assertInstanceOf(TransactionCommitFailedException.class,
23             mapper.newWithCause("test_cause", cause));
24         assertSame(cause, ex.getCause());
25     }
26 }