mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-10 21:31:53 +01:00
Keep persisted disabled status when thing is removed (#493)
Also-By: Florian Stolte <fstolte@itemis.de> Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
parent
5e2e7b1e16
commit
3b6dfbeddb
@ -484,7 +484,6 @@ public class ThingManagerImpl
|
||||
}
|
||||
}
|
||||
|
||||
storage.remove(thing.getUID().getAsString());
|
||||
this.things.remove(thing);
|
||||
}
|
||||
|
||||
|
@ -913,7 +913,7 @@ public class ThingManagerOSGiJavaTest extends JavaOSGiTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStorageEntryRemovedOnThingRemoval() throws Exception {
|
||||
public void testStorageEntryRetainedOnThingRemoval() throws Exception {
|
||||
registerThingTypeProvider();
|
||||
|
||||
AtomicReference<ThingHandlerCallback> thingHandlerCallback = new AtomicReference<>();
|
||||
@ -981,8 +981,10 @@ public class ThingManagerOSGiJavaTest extends JavaOSGiTest {
|
||||
new Thread((Runnable) () -> managedThingProvider.remove(THING.getUID())).start();
|
||||
|
||||
waitForAssert(() -> {
|
||||
assertThat(storage.containsKey(THING_UID.getAsString()), is(false));
|
||||
assertThat(thingRegistry.get(THING.getUID()), is(equalTo(null)));
|
||||
}, SafeCaller.DEFAULT_TIMEOUT - 100, 50);
|
||||
|
||||
assertThat(storage.containsKey(THING_UID.getAsString()), is(true));
|
||||
}
|
||||
|
||||
private void assertThingStatus(Map<String, Object> propsThing, Map<String, Object> propsChannel, ThingStatus status,
|
||||
|
Loading…
Reference in New Issue
Block a user