]> git.basschouten.com Git - openhab-addons.git/blob
9df0754c0d46f278d5f2a4aa6ac6c34547f536c2
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.bmwconnecteddrive.internal.dto;
14
15 import static org.junit.jupiter.api.Assertions.assertEquals;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.junit.jupiter.api.Test;
19 import org.openhab.binding.bmwconnecteddrive.internal.dto.remote.ExecutionStatus;
20 import org.openhab.binding.bmwconnecteddrive.internal.dto.remote.ExecutionStatusContainer;
21 import org.openhab.binding.bmwconnecteddrive.internal.handler.RemoteServiceHandler.ExecutionState;
22 import org.openhab.binding.bmwconnecteddrive.internal.util.FileReader;
23
24 import com.google.gson.Gson;
25
26 /**
27  * The {@link RemoteStatusTest} Test json responses from ConnectedDrive Portal
28  *
29  * @author Bernd Weymann - Initial contribution
30  */
31 @NonNullByDefault
32 @SuppressWarnings("null")
33 public class RemoteStatusTest {
34     private static final Gson GSON = new Gson();
35
36     @Test
37     public void testStatus() {
38         String resource1 = FileReader.readFileInString("src/test/resources/webapi/remote-services/pending.json");
39         ExecutionStatusContainer esc = GSON.fromJson(resource1, ExecutionStatusContainer.class);
40         ExecutionStatus execStatus = esc.executionStatus;
41         assertEquals(ExecutionState.PENDING.name(), execStatus.status, "Status");
42     }
43 }