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.fmiweather;
15 import static org.hamcrest.CoreMatchers.is;
16 import static org.hamcrest.MatcherAssert.assertThat;
17 import static org.junit.jupiter.api.Assertions.assertNotNull;
19 import java.nio.file.Path;
21 import org.junit.jupiter.api.BeforeEach;
22 import org.junit.jupiter.api.Test;
23 import org.openhab.binding.fmiweather.internal.client.Client;
24 import org.openhab.binding.fmiweather.internal.client.FMIResponse;
27 * Test cases for {@link Client.parseMultiPointCoverageXml} with an "empty" (no data) XML response
29 * @author Sami Salonen - Initial contribution
31 public class FMIResponseParsingEmptyTest extends AbstractFMIResponseParsingTest {
33 private Path observations = getTestResource("observations_empty.xml");
35 private FMIResponse observationsResponse;
39 client = new Client();
41 observationsResponse = parseMultiPointCoverageXml(readTestResourceUtf8(observations));
42 } catch (Throwable e) {
43 throw new RuntimeException("Test data malformed", e);
45 assertNotNull(observationsResponse);
49 public void testLocationsSinglePlace() throws Throwable {
50 assertThat(observationsResponse.getLocations().size(), is(0));