CommitInfo forward compatibility
[mdsal.git] / common / mdsal-common-api / src / test / java / org / opendaylight / mdsal / common / api / DataValidationFailedExceptionTest.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.assertSame;
12
13 import org.junit.jupiter.api.Test;
14 import org.opendaylight.yangtools.concepts.HierarchicalIdentifier;
15
16 class DataValidationFailedExceptionTest {
17     @Test
18     void dataValidationFailedExceptionTest() throws Exception {
19         final var testObj = new TestClass();
20         final var dataValidationFailedException = new DataValidationFailedException(TestClass.class, testObj, "test");
21         assertEquals(testObj, dataValidationFailedException.getPath());
22         assertSame(TestClass.class, dataValidationFailedException.getPathType());
23     }
24
25     private static final class TestClass implements HierarchicalIdentifier<TestClass> {
26         @java.io.Serial
27         private static final long serialVersionUID = 1L;
28
29         @Override
30         public boolean contains(final TestClass other) {
31             return false;
32         }
33     }
34 }