]> git.basschouten.com Git - openhab-addons.git/blob
fd97c3c036f2c30c5e8c06e5fb88310de0b01013
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.nanoleaf.internal;
14
15 import static org.hamcrest.CoreMatchers.is;
16 import static org.hamcrest.MatcherAssert.assertThat;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.junit.jupiter.api.Test;
20
21 /**
22  * Test Firmware check
23  *
24  * @author Stefan Höhn - Initial contribution
25  */
26
27 @NonNullByDefault
28 public class OpenAPIUtilsTest {
29
30     @Test
31     public void testStateOn() {
32         int[] versions = OpenAPIUtils.getFirmwareVersionNumbers("5.1.2");
33         assertThat(versions[0], is(5));
34         assertThat(versions[1], is(1));
35         assertThat(versions[2], is(2));
36         int[] versions2 = OpenAPIUtils.getFirmwareVersionNumbers("5.1.2-4");
37         assertThat(versions2[0], is(5));
38         assertThat(versions2[1], is(1));
39         assertThat(versions2[2], is(2));
40         assertThat(versions2[3], is(4));
41     }
42 }