openhab1-addons icon indicating copy to clipboard operation
openhab1-addons copied to clipboard

[MQTT][Tests] canParseCommand test failing

Open 9037568 opened this issue 6 years ago • 1 comments

Current Behavior

While investigating #5589, I ran across this.

The MQTT test suite is failing. Not sure when it started failing. The error is:

Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.014 sec <<< FAILURE! - in org.openhab.binding.mqtt.internal.MqttMessageSubscriberTest
canParseCommand(org.openhab.binding.mqtt.internal.MqttMessageSubscriberTest)  Time elapsed: 0.004 sec  <<< FAILURE!
java.lang.AssertionError: expected:<53.3239919,-6.5258807> but was:<null>
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.failNotEquals(Assert.java:743)
        at org.junit.Assert.assertEquals(Assert.java:118)
        at org.junit.Assert.assertEquals(Assert.java:144)
        at org.openhab.binding.mqtt.internal.MqttMessageSubscriberTest.canParseCommand(MqttMessageSubscriberTest.java:140)

canDetectInvalidConfigurations(org.openhab.binding.mqtt.internal.MqttMessageSubscriberTest)  Time elapsed: 0.001 sec
canParseState(org.openhab.binding.mqtt.internal.MqttMessageSubscriberTest)  Time elapsed: 0.001 sec
canParseValidConfigurations(org.openhab.binding.mqtt.internal.MqttMessageSubscriberTest)  Time elapsed: 0 sec

Results :

Failed tests:
  MqttMessageSubscriberTest.canParseCommand:140 expected:<53.3239919,-6.5258807> but was:<null>

The failure is coming from this line:

assertEquals(PointType.valueOf("53.3239919,-6.5258807"), subscriber.getCommand(PointType.valueOf("53.3239919,-6.5258807").toString(), locationItem.getAcceptedCommandTypes()));

This appears to be because the LocationItem does not accept any command types.

Possible solution:

If this test is no longer valid, remove this test.

9037568 avatar Jun 01 '18 11:06 9037568

With the new MQTT binding, sounds like it does not make sense to fix old binding bugs...

yveshanoulle avatar Jan 09 '19 16:01 yveshanoulle