]> git.basschouten.com Git - openhab-addons.git/blob
3d9b39a7e2d1a38e9ab634c22f674a4a91dbd61b
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.boschshc.internal.exceptions;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19
20 /**
21  * Unit tests for {@link PairingFailedException}.
22  *
23  * @author David Pace - Initial contribution
24  *
25  */
26 @NonNullByDefault
27 class PairingFailedExceptionTest {
28
29     @Test
30     void testConstructor() {
31         PairingFailedException fixture = new PairingFailedException();
32         assertNotNull(fixture);
33         assertNull(fixture.getMessage());
34         assertNull(fixture.getCause());
35     }
36
37     @Test
38     void testConstructorWithMessage() {
39         PairingFailedException fixture = new PairingFailedException("message");
40         assertNotNull(fixture);
41         assertEquals("message", fixture.getMessage());
42         assertNull(fixture.getCause());
43     }
44
45     @Test
46     void testConstructorWithMessageAndCause() {
47         RuntimeException testException = new RuntimeException("test exception");
48         PairingFailedException fixture = new PairingFailedException("message", testException);
49         assertNotNull(fixture);
50         assertEquals("message", fixture.getMessage());
51         assertSame(testException, fixture.getCause());
52     }
53 }