CommitInfo forward compatibility
[mdsal.git] / common / mdsal-common-api / src / test / java / org / opendaylight / mdsal / common / api / TransactionCommitDeadlockExceptionTest.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.jupiter.api.Assertions.assertEquals;
11 import static org.junit.jupiter.api.Assertions.assertNull;
12 import static org.junit.jupiter.api.Assertions.assertSame;
13
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;
20
21 @ExtendWith(MockitoExtension.class)
22 class TransactionCommitDeadlockExceptionTest {
23     @Mock
24     private RpcError rpcError;
25
26     @Test
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());
33     }
34 }