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.sensibo.internal.dto;
15 import static org.junit.jupiter.api.Assertions.*;
17 import java.io.IOException;
19 import org.junit.jupiter.api.Test;
20 import org.openhab.binding.sensibo.internal.dto.poddetails.AcStateDTO;
21 import org.openhab.binding.sensibo.internal.dto.settimer.SetTimerRequest;
24 * @author Arne Seime - Initial contribution
26 public class SetTimerRequestTest extends AbstractSerializationDeserializationTest {
29 public void testSerializeDeserialize() throws IOException {
30 AcStateDTO acState = new AcStateDTO(false, "fanLevel", "C", 21, "mode", "swing");
31 SetTimerRequest req = new SetTimerRequest("PODID", 60, acState);
32 String serializedJson = wireHelper.serialize(req);
34 final SetTimerRequest deSerializedRequest = wireHelper.deSerializeFromString(serializedJson,
35 SetTimerRequest.class);
36 assertNotNull(deSerializedRequest.acState);
37 assertEquals(60, deSerializedRequest.minutesFromNow);
38 assertFalse(deSerializedRequest.acState.on);