2 * Copyright (c) 2010-2022 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.bmwconnecteddrive.internal.dto;
15 import static org.junit.jupiter.api.Assertions.assertEquals;
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;
24 import com.google.gson.Gson;
27 * The {@link RemoteStatusTest} Test json responses from ConnectedDrive Portal
29 * @author Bernd Weymann - Initial contribution
32 @SuppressWarnings("null")
33 public class RemoteStatusTest {
34 private static final Gson GSON = new Gson();
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");