Fix issues with tests after core-changes (#12817)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K
2022-05-27 09:07:15 +02:00
committed by GitHub
parent 2403ffcb86
commit 87023da9e3
16 changed files with 54 additions and 28 deletions

View File

@@ -15,7 +15,6 @@ package org.openhab.binding.irobot.internal.handler;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
import java.lang.reflect.Field;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
@@ -38,9 +37,10 @@ import org.openhab.core.thing.ThingTypeUID;
import org.openhab.core.thing.ThingUID;
import org.openhab.core.thing.binding.ThingHandlerCallback;
import org.openhab.core.thing.internal.ThingImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.spi.LocationAwareLogger;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
/**
* Test the MQTT protocol with local iRobot (without openhab running).
@@ -66,11 +66,8 @@ public class RoombaHandlerTest {
@BeforeEach
void setUp() throws Exception {
Logger logger = LoggerFactory.getLogger(RoombaHandler.class);
Field logLevelField = logger.getClass().getDeclaredField("currentLogLevel");
logLevelField.setAccessible(true);
logLevelField.set(logger, LocationAwareLogger.TRACE_INT);
final Logger logger = (Logger) LoggerFactory.getLogger(RoombaHandler.class);
logger.setLevel(Level.TRACE);
Configuration config = new Configuration();
config.put("ipaddress", RoombaHandlerTest.IP_ADDRESS);
config.put("password", RoombaHandlerTest.PASSWORD);