2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.boschshc.internal.exceptions;
15 import static org.junit.jupiter.api.Assertions.*;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
21 * Unit tests for {@link PairingFailedException}.
23 * @author David Pace - Initial contribution
27 class PairingFailedExceptionTest {
30 void testConstructor() {
31 PairingFailedException fixture = new PairingFailedException();
32 assertNotNull(fixture);
33 assertNull(fixture.getMessage());
34 assertNull(fixture.getCause());
38 void testConstructorWithMessage() {
39 PairingFailedException fixture = new PairingFailedException("message");
40 assertNotNull(fixture);
41 assertEquals("message", fixture.getMessage());
42 assertNull(fixture.getCause());
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());