Skip to content

Commit

Permalink
Update tests with correct package paths
Browse files Browse the repository at this point in the history
  • Loading branch information
davidepianca98 committed Aug 15, 2020
1 parent 7a5763c commit c38bf4d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/commonMain/kotlin/mqtt/broker/ClientConnection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package mqtt.broker
import currentTimeMillis
import generateRandomClientId
import mqtt.*
import mqtt.packets.ConnectAcknowledgeFlags
import mqtt.packets.Qos
import mqtt.packets.mqttv5.*
import socket.SocketInterface
Expand Down Expand Up @@ -118,7 +119,7 @@ class ClientConnection(
fun disconnect(reasonCode: ReasonCode, serverReference: String? = null) {
if (!connectCompleted) {
val connack = MQTTConnack(
MQTTConnack.ConnectAcknowledgeFlags(false),
ConnectAcknowledgeFlags(false),
reasonCode,
MQTTProperties().apply { this.serverReference = serverReference })
writePacket(connack)
Expand Down Expand Up @@ -392,7 +393,7 @@ class ClientConnection(
}

val connack = MQTTConnack(
MQTTConnack.ConnectAcknowledgeFlags(sessionPresent),
ConnectAcknowledgeFlags(sessionPresent),
ReasonCode.SUCCESS,
connackProperties
)
Expand Down
3 changes: 2 additions & 1 deletion src/commonTest/kotlin/mqtt/packets/mqttv5/TestMQTTConnack.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mqtt.packets.mqttv5

import mqtt.packets.ConnectAcknowledgeFlags
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
Expand All @@ -8,7 +9,7 @@ class TestMQTTConnack {

private val array = ubyteArrayOf(0x20u, 0x29u, 0x00u, 0x00u, 0x26u, 0x12u, 0x00u, 0x1Eu, 0x78u, 0x74u, 0x71u, 0x71u, 0x77u, 0x6Fu, 0x72u, 0x6Au, 0x6Au, 0x6Eu, 0x68u, 0x66u, 0x73u, 0x6Bu, 0x77u, 0x78u, 0x65u, 0x61u, 0x74u, 0x6Fu, 0x6Du, 0x79u, 0x66u, 0x72u, 0x63u, 0x6du, 0x6eu, 0x6au, 0x65u, 0x66u, 0x27u, 0x00u, 0x00u, 0x80u, 0x00u)
private val packet = MQTTConnack(
MQTTConnack.ConnectAcknowledgeFlags(false),
ConnectAcknowledgeFlags(false),
ReasonCode.SUCCESS,
MQTTProperties().apply {
assignedClientIdentifier = "xtqqworjjnhfskwxeatomyfrcmnjef"
Expand Down
3 changes: 2 additions & 1 deletion src/commonTest/kotlin/mqtt/packets/mqttv5/TestMQTTConnect.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mqtt.packets.mqttv5

import mqtt.packets.ConnectFlags
import mqtt.packets.Qos
import kotlin.test.Test
import kotlin.test.assertEquals
Expand All @@ -11,7 +12,7 @@ class TestMQTTConnect {
private val packet = MQTTConnect(
"MQTT",
5,
MQTTConnect.Companion.ConnectFlags(
ConnectFlags(
false,
false,
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TestMQTTSubscribe {
listOf(
Subscription(
"test/topic/+",
MQTTSubscribe.Companion.SubscriptionOptions(Qos.AT_MOST_ONCE, false, false, 0u)
SubscriptionOptions(Qos.AT_MOST_ONCE, false, false, 0u)
)
)
)
Expand Down

0 comments on commit c38bf4d

Please sign in to comment.