Skip to content

Commit

Permalink
fix(proteus): call correct endpoint for uploading prekeys (#2093)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitorhugods authored and github-actions[bot] committed Sep 26, 2023
1 parent 5628a66 commit 44aa080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ internal open class PreKeyApiV0 internal constructor(

override suspend fun uploadNewPrekeys(clientId: String, preKeys: List<PreKeyDTO>): NetworkResponse<Unit> =
wrapKaliumResponse {
httpClient.put("$PATH_CLIENTS/$clientId/$PATH_PRE_KEY") {
httpClient.put("$PATH_CLIENTS/$clientId") {
setBody(UploadPreKeysRequest(preKeys))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ internal class PrekeyApiV0Test : ApiTest() {
@Test
fun givenPreKeyAndClientId_whenUploadingPreKeys_thenTheRequestIsConfiguredCorrectly() = runTest {
val preKeyDTO = PreKeyDTO(42, "testKey")
val clientId = "testClientId"
val networkClient = mockAuthenticatedNetworkClient(
responseBody = "",
statusCode = HttpStatusCode.OK,
assertion = {
assertPathEqual("/clients/$clientId")
assertJson()
assertJsonBodyContent(
"""
Expand All @@ -103,7 +105,7 @@ internal class PrekeyApiV0Test : ApiTest() {
}
)
val preKeyApi: PreKeyApi = PreKeyApiV0(networkClient)
val response = preKeyApi.uploadNewPrekeys("clientId", listOf(preKeyDTO))
val response = preKeyApi.uploadNewPrekeys(clientId, listOf(preKeyDTO))
assertTrue(response.isSuccessful())
}

Expand Down

0 comments on commit 44aa080

Please sign in to comment.