2 * Copyright (c) 2010-2020 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.junit.Assert.*;
18 import java.nio.file.Path;
20 import org.junit.Before;
21 import org.junit.Test;
22 import org.openhab.binding.fmiweather.internal.client.Client;
23 import org.openhab.binding.fmiweather.internal.client.FMIResponse;
26 * Test cases for {@link Client.parseMultiPointCoverageXml} with an "empty" (no data) XML response
28 * @author Sami Salonen - Initial contribution
30 public class FMIResponseParsingEmptyTest extends AbstractFMIResponseParsingTest {
32 private Path observations = getTestResource("observations_empty.xml");
34 private FMIResponse observationsResponse;
38 client = new Client();
40 observationsResponse = parseMultiPointCoverageXml(readTestResourceUtf8(observations));
41 } catch (Throwable e) {
42 throw new RuntimeException("Test data malformed", e);
44 assertNotNull(observationsResponse);
48 public void testLocationsSinglePlace() throws Throwable {
49 assertThat(observationsResponse.getLocations().size(), is(0));