]> git.basschouten.com Git - openhab-addons.git/blob
1d18f08eb248dbc4cf42568ee7de84217496e9c0
[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.ahawastecollection.internal;
14
15 import static org.junit.jupiter.api.Assertions.assertEquals;
16
17 import java.util.Map;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.junit.jupiter.api.Disabled;
21 import org.junit.jupiter.api.Test;
22 import org.openhab.binding.ahawastecollection.internal.CollectionDate.WasteType;
23
24 /**
25  * @author Sönke Küper - Initial contribution
26  */
27 @NonNullByDefault
28 @Disabled("These tests use the real website which may not always be available")
29 public class AhaCollectionScheduleTest {
30
31     @Test
32     public void testGetValuesForHannoverCity() throws Exception {
33         final AhaCollectionScheduleImpl schedule = new AhaCollectionScheduleImpl("Hannover",
34                 "02095@Oesterleystr.+/+Südstadt@Südstadt", "10", "", "02095-0010+");
35         final Map<WasteType, CollectionDate> dates = schedule.getCollectionDates();
36         // No bio waste is collected here
37         assertEquals(3, dates.size());
38     }
39
40     @Test
41     public void testGetValuesForRegion() throws Exception {
42         final AhaCollectionScheduleImpl schedule = new AhaCollectionScheduleImpl("Lehrte",
43                 "70185@Haselnussweg+/+Hämelerwald@Hämelerwald", "12", "", "70185-0012+");
44         final Map<WasteType, CollectionDate> dates = schedule.getCollectionDates();
45         // All four waste types are collected here.
46         assertEquals(4, dates.size());
47     }
48 }