Skip to content

Commit

Permalink
Fix headers order in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joffrey-bion committed Sep 17, 2024
1 parent 59a4a0a commit 83484b8
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class StompCodecTest {
fun stomp_basic() {
val frameText = """
STOMP
host:some.host
accept-version:1.2
host:some.host
$nullChar
""".trimIndent()
Expand All @@ -28,8 +28,8 @@ class StompCodecTest {
fun connect_basic() {
val frameText = """
CONNECT
host:some.host
accept-version:1.2
host:some.host
$nullChar
""".trimIndent()
Expand All @@ -45,8 +45,8 @@ class StompCodecTest {
fun connect_default() {
val frameText = """
CONNECT
host:some.host
accept-version:1.2,1.1,1.0
host:some.host
$nullChar
""".trimIndent()
Expand All @@ -60,8 +60,8 @@ class StompCodecTest {
fun connect_credentials() {
val frameText = """
CONNECT
host:some.host
accept-version:1.2
host:some.host
login:bob
passcode:mypass
Expand All @@ -81,8 +81,8 @@ class StompCodecTest {
fun connect_custom_headers() {
val frameText = """
CONNECT
host:some.host
accept-version:1.2
host:some.host
login:bob
passcode:mypass
Authorization:Bearer -jwt-
Expand All @@ -104,8 +104,8 @@ class StompCodecTest {
fun connect_versions() {
val frameText = """
CONNECT
host:some.host
accept-version:1.0,1.1,1.2
host:some.host
$nullChar
""".trimIndent()
Expand Down Expand Up @@ -164,8 +164,8 @@ class StompCodecTest {
fun subscribe_custom_headers() {
val frameText = """
SUBSCRIBE
destination:/topic/dest
id:0
destination:/topic/dest
ack:auto
receipt:message-1234
Authorization:Bearer -jwt-
Expand Down Expand Up @@ -420,9 +420,11 @@ class StompCodecTest {
}

private fun assertEncodingDecoding(frameText: String, textFrame: StompFrame, binFrame: StompFrame) {
val frameBytes = frameText.encodeToByteString()
assertEquals(textFrame, frameText.decodeToStompFrame())
assertEquals(binFrame, frameText.encodeToByteString().decodeToStompFrame())
assertEquals(binFrame, frameBytes.decodeToStompFrame())
assertEquals(frameText, textFrame.encodeToText())
assertEquals(frameText.encodeToByteString(), textFrame.encodeToByteString())
assertEquals(frameBytes, textFrame.encodeToByteString())
assertEquals(frameBytes, binFrame.encodeToByteString())
}
}

0 comments on commit 83484b8

Please sign in to comment.