Improve ThingManagerOSGiTest (#2858)

This change ensures that the storage of bridge and thing are done before the initialization is reported.

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2022-03-19 21:09:02 +01:00 committed by GitHub
parent 79e070c7ac
commit 45b5c6772a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1806,9 +1806,9 @@ public class ThingManagerOSGiTest extends JavaOSGiTest {
doAnswer(new Answer<Void>() {
@Override
public @Nullable Void answer(InvocationOnMock invocation) throws Throwable {
bridgeState.childHandlerInitializedCalled = true;
bridgeState.initializedHandler = (ThingHandler) invocation.getArgument(0);
bridgeState.initializedThing = (Thing) invocation.getArgument(1);
bridgeState.childHandlerInitializedCalled = true;
return null;
}
}).when(bridgeHandler).childHandlerInitialized(any(ThingHandler.class), any(Thing.class));
@ -1816,9 +1816,9 @@ public class ThingManagerOSGiTest extends JavaOSGiTest {
doAnswer(new Answer<Void>() {
@Override
public @Nullable Void answer(InvocationOnMock invocation) throws Throwable {
bridgeState.childHandlerDisposedCalled = true;
bridgeState.disposedHandler = (ThingHandler) invocation.getArgument(0);
bridgeState.disposedThing = (Thing) invocation.getArgument(1);
bridgeState.childHandlerDisposedCalled = true;
return null;
}
}).when(bridgeHandler).childHandlerDisposed(any(ThingHandler.class), any(Thing.class));