]> git.basschouten.com Git - openhab-addons.git/blob
c8efd2f5f828604ebbf31d3ad031de9b29f7109a
[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.sensibo.internal.dto;
14
15 import static org.junit.jupiter.api.Assertions.*;
16
17 import java.io.IOException;
18 import java.lang.reflect.Type;
19 import java.util.ArrayList;
20 import java.util.List;
21
22 import org.junit.jupiter.api.Test;
23 import org.openhab.binding.sensibo.internal.dto.pods.PodDTO;
24
25 import com.google.gson.reflect.TypeToken;
26
27 /**
28  * @author Arne Seime - Initial contribution
29  */
30 public class GetPodsResponseTest extends AbstractSerializationDeserializationTest {
31
32     @Test
33     public void testDeserialize() throws IOException {
34         final Type type = new TypeToken<ArrayList<PodDTO>>() {
35         }.getType();
36
37         final List<PodDTO> rsp = wireHelper.deSerializeResponse("/get_pods_response.json", type);
38
39         assertEquals(1, rsp.size());
40         assertEquals("PODID", rsp.get(0).id);
41     }
42 }