-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add a deprecated getBody to Responses, and fix operation executi…
…on with empty responses (#564) fix: add a deprecated getBody to Response fix: execution of operations with empty responses chore: add tests for TransactionId chore: clean up apiExceptions mustache helper chore: clean up mustache helpers
- Loading branch information
Showing
5 changed files
with
89 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
core/src/test/kotlin/com/expediagroup/sdk/core/model/TransactionIdTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.expediagroup.sdk.core.model | ||
|
||
import io.mockk.every | ||
import io.mockk.mockkStatic | ||
import org.junit.jupiter.api.Test | ||
import java.util.UUID | ||
|
||
class TransactionIdTest { | ||
private val uuids = listOf(UUID.randomUUID(), UUID.randomUUID()) | ||
|
||
@Test | ||
fun `peek should return a UUID`() { | ||
mockkStatic(UUID::class) { | ||
every { UUID.randomUUID() } returnsMany uuids | ||
val transactionId = TransactionId() | ||
assert(transactionId.peek() == uuids[0]) | ||
assert(transactionId.peek() == uuids[0]) | ||
} | ||
} | ||
|
||
@Test | ||
fun `dequeue should return a UUID and change it`() { | ||
mockkStatic(UUID::class) { | ||
every { UUID.randomUUID() } returnsMany uuids | ||
val transactionId = TransactionId() | ||
assert(transactionId.dequeue() == uuids[0]) | ||
assert(transactionId.peek() == uuids[1]) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters