Fix MQTT connection tests according to specification
This commit is contained in:
parent
b37a708f40
commit
29602c208e
@ -34,7 +34,7 @@ public abstract class AbstractMqttClientConnectionTest extends AbstractMqttInteg
|
||||
try {
|
||||
client.connectAndWait("wrongAccessToken");
|
||||
} catch (MqttException e) {
|
||||
Assert.assertEquals(MqttException.REASON_CODE_FAILED_AUTHENTICATION, e.getReasonCode());
|
||||
Assert.assertEquals(MqttException.REASON_CODE_NOT_AUTHORIZED, e.getReasonCode());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ public class BasicMqttCredentialsTest extends AbstractMqttIntegrationTest {
|
||||
mqttTestClient.connectAndWait(USER_NAME3, "WRONG PASSWORD");
|
||||
Assert.fail(); // This should not happens, because we have a wrong password
|
||||
} catch (MqttException e) {
|
||||
Assert.assertEquals(4, e.getReasonCode()); // 4 - Reason code for bad username or password in MQTT v3
|
||||
Assert.assertEquals(5, e.getReasonCode()); // 4 - Reason code not authorized in MQTT v3
|
||||
}
|
||||
Assertions.assertThrows(MqttException.class, () -> {
|
||||
testTelemetryIsNotDelivered(clientIdAndUserNameAndPasswordDevice3, mqttTestClient);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user