Fix build after core-changes (#14431)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K
2023-02-18 15:24:58 +01:00
committed by GitHub
parent ce41708622
commit cb07f3e2f0
5 changed files with 34 additions and 20 deletions

View File

@@ -25,6 +25,7 @@ import java.time.format.DateTimeParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.function.Function;
@@ -36,6 +37,7 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.mockito.ArgumentMatchers;
import org.openhab.binding.nest.internal.wwn.config.WWNAccountConfiguration;
import org.openhab.binding.nest.internal.wwn.test.WWNTestAccountHandler;
import org.openhab.binding.nest.internal.wwn.test.WWNTestApiServlet;
@@ -61,6 +63,7 @@ import org.openhab.core.thing.ThingProvider;
import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.openhab.core.thing.binding.ThingHandlerFactory;
import org.openhab.core.thing.binding.ThingTypeProvider;
import org.openhab.core.thing.binding.builder.BridgeBuilder;
import org.openhab.core.thing.binding.builder.ChannelBuilder;
import org.openhab.core.thing.link.ItemChannelLink;
@@ -172,6 +175,11 @@ public abstract class WWNThingHandlerOSGiTest extends JavaOSGiTest {
Map.of(WWNTestHandlerFactory.REDIRECT_URL_CONFIG_PROPERTY, REDIRECT_URL));
registerService(nestTestHandlerFactory);
ThingTypeProvider thingTypeProvider = mock(ThingTypeProvider.class);
when(thingTypeProvider.getThingType(ArgumentMatchers.any(ThingTypeUID.class), nullable(Locale.class)))
.thenReturn(mock(ThingType.class));
registerService(thingTypeProvider);
nestTestHandlerFactory = getService(ThingHandlerFactory.class, WWNTestHandlerFactory.class);
assertThat("Could not get NestTestHandlerFactory", nestTestHandlerFactory, is(notNullValue()));