Adjustments for nullness annotated TypeParser (#10068)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
committed by
GitHub
parent
8a2ac82b07
commit
1210fec9f9
@@ -267,13 +267,15 @@ public class HomieThingHandlerTests {
|
||||
// Assign old value
|
||||
Value value = property.getChannelState().getCache();
|
||||
Command command = TypeParser.parseCommand(value.getSupportedCommandTypes(), "OLDVALUE");
|
||||
property.getChannelState().getCache().update(command);
|
||||
// Try to update with new value
|
||||
updateValue = new StringType("SOMETHINGNEW");
|
||||
thingHandler.handleCommand(property.channelUID, updateValue);
|
||||
// Expect old value and no MQTT publish
|
||||
assertThat(property.getChannelState().getCache().getChannelState().toString(), is("OLDVALUE"));
|
||||
verify(connection, times(1)).publish(any(), any(), anyInt(), anyBoolean());
|
||||
if (command != null) {
|
||||
property.getChannelState().getCache().update(command);
|
||||
// Try to update with new value
|
||||
updateValue = new StringType("SOMETHINGNEW");
|
||||
thingHandler.handleCommand(property.channelUID, updateValue);
|
||||
// Expect old value and no MQTT publish
|
||||
assertThat(property.getChannelState().getCache().getChannelState().toString(), is("OLDVALUE"));
|
||||
verify(connection, times(1)).publish(any(), any(), anyInt(), anyBoolean());
|
||||
}
|
||||
}
|
||||
|
||||
public Object createSubscriberAnswer(InvocationOnMock invocation) {
|
||||
|
||||
Reference in New Issue
Block a user