[wemo] Fix UPnP resubscription after lost network connection (#12648)

Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
Jacob Laursen
2022-04-25 11:16:47 +02:00
committed by GitHub
parent 270c917e66
commit 241a613d65
17 changed files with 131 additions and 148 deletions

View File

@@ -143,7 +143,7 @@ public class WemoInsightHandlerTest {
String channelToWatch;
public MockWemoInsightHandler(Thing thing, String channelToWatch) {
super(thing, null, new WemoHttpCall());
super(thing, null, null, new WemoHttpCall());
this.channelToWatch = channelToWatch;
}

View File

@@ -40,7 +40,6 @@ import org.jupnp.model.types.UDN;
import org.mockito.Mockito;
import org.openhab.binding.wemo.internal.WemoBindingConstants;
import org.openhab.binding.wemo.internal.WemoHttpCallFactory;
import org.openhab.binding.wemo.internal.WemoUtil;
import org.openhab.binding.wemo.internal.http.WemoHttpCall;
import org.openhab.core.config.core.Configuration;
import org.openhab.core.io.transport.upnp.UpnpIOService;
@@ -101,8 +100,6 @@ public abstract class GenericWemoOSGiTest extends JavaOSGiTest {
protected Thing thing;
protected void setUpServices() throws IOException {
WemoUtil.serviceAvailableFunction = (host, port) -> true;
// StorageService is required from the ManagedThingProvider
VolatileStorageService volatileStorageService = new VolatileStorageService();
registerService(volatileStorageService);
@@ -123,6 +120,7 @@ public abstract class GenericWemoOSGiTest extends JavaOSGiTest {
assertThat(upnpIOService, is(notNullValue()));
mockCaller = Mockito.spy(new WemoHttpCall());
doReturn(true).when(mockCaller).probeURL(any());
WemoHttpCallFactory wemoHttpCallFactory = () -> mockCaller;
registerService(wemoHttpCallFactory, WemoHttpCallFactory.class.getName());