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;
10 import static org.junit.jupiter.api.Assertions.assertInstanceOf;
11 import static org.junit.jupiter.api.Assertions.assertSame;
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
16 class TransactionCommitFailedExceptionMapperTest {
17 private final TransactionCommitFailedExceptionMapper mapper = TransactionCommitFailedExceptionMapper.create("test");
21 final var cause = new Throwable();
22 final var ex = assertInstanceOf(TransactionCommitFailedException.class,
23 mapper.newWithCause("test_cause", cause));
24 assertSame(cause, ex.getCause());