-
Notifications
You must be signed in to change notification settings - Fork 1
Update rest messages, part 1 #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
network/src/test/groovy/javasabr/mqtt/network/message/out/SubscribeMqtt5OutMessageTest.groovy
Outdated
Show resolved
Hide resolved
| inMessage.exception().message == expectedMessage | ||
| where: | ||
| property | value | expectedMessage | ||
| MqttMessageProperty.WILDCARD_SUBSCRIPTION_AVAILABLE | 2 | MqttProtocolErrors.PROVIDED_INVALID_WILDCARD_SUBSCRIPTION_AVAILABLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to use on-demand imports in such cases. This makes tests more readable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crazyrokr I prefer to see from which class the constant is
| inMessage.sessionPresent() == sessionPresent | ||
| inMessage.serverReference() == serverReference | ||
| inMessage.reason() == reasonString | ||
| inMessage.assignedClientId() == mqtt311ClientId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we consider to use the following style in tests?
with(inMessage) {
reasonCode() == ConnectAckReasonCode.NOT_AUTHORIZED
sessionPresent() == sessionPresent
serverReference() == null
reason() == null
assignedClientId() == null
authenticationData() == null
authenticationMethod() == null
responseInformation() == null
maxQos() == null
retainAvailable() == RETAIN_AVAILABLE_IS_NOT_SET
sharedSubscriptionAvailable() == SHARED_SUBSCRIPTION_AVAILABLE_IS_NOT_SET
wildcardSubscriptionAvailable() == WILDCARD_SUBSCRIPTION_AVAILABLE_IS_NOT_SET
subscriptionIdAvailable() == SUBSCRIPTION_IDENTIFIER_AVAILABLE_IS_NOT_SET
maxMessageSize() == MAXIMUM_MESSAGE_SIZE_IS_NOT_SET
serverKeepAlive() == SERVER_KEEP_ALIVE_IS_NOT_SET
sessionExpiryInterval() == SESSION_EXPIRY_INTERVAL_IS_NOT_SET
topicAliasMaxValue() == TOPIC_ALIAS_MAXIMUM_IS_NOT_SET
receiveMaxPublishes() == RECEIVE_MAXIMUM_PUBLISHES_IS_NOT_SET
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crazyrokr to avoid using reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will use it for the next tests
|
|
Update rest messages to follow MQTT specs.