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.nanoleaf.internal;
15 import static org.hamcrest.CoreMatchers.is;
16 import static org.hamcrest.MatcherAssert.assertThat;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.junit.jupiter.api.Test;
24 * @author Stefan Höhn - Initial contribution
28 public class OpenAPIUtilsTest {
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));