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.common.api;
10 import static org.junit.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertNull;
12 import static org.junit.jupiter.api.Assertions.assertSame;
14 import java.util.List;
15 import org.junit.jupiter.api.Test;
16 import org.junit.jupiter.api.extension.ExtendWith;
17 import org.mockito.Mock;
18 import org.mockito.junit.jupiter.MockitoExtension;
19 import org.opendaylight.yangtools.yang.common.RpcError;
21 @ExtendWith(MockitoExtension.class)
22 class TransactionCommitDeadlockExceptionTest {
24 private RpcError rpcError;
27 void transactionCommitDeadlockExceptionTest() throws Exception {
28 final var message = TransactionCommitDeadlockException.DEADLOCK_EXCEPTION_SUPPLIER.get().getMessage();
29 final var ex = new TransactionCommitDeadlockException(message, rpcError);
30 assertSame(message, ex.getMessage());
31 assertNull(ex.getCause());
32 assertEquals(List.of(rpcError), ex.getErrorList());