Skip to content

Commit

Permalink
fix(PrivateThirdPartyEndpoint): Swap order of load() params
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Mar 10, 2021
1 parent 785a387 commit 9455af4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public sealed class ThirdPartyEndpoint(
thirdPartyPrivateAddress: String
): ThirdPartyEndpoint? =
PublicThirdPartyEndpoint.load(thirdPartyPrivateAddress)
?: PrivateThirdPartyEndpoint.load(firstPartyAddress, thirdPartyPrivateAddress)
?: PrivateThirdPartyEndpoint.load(thirdPartyPrivateAddress, firstPartyAddress)
}
}

Expand All @@ -49,8 +49,8 @@ public class PrivateThirdPartyEndpoint internal constructor(
*/
@Throws(PersistenceException::class)
public suspend fun load(
firstPartyAddress: String,
thirdPartyAddress: String
thirdPartyAddress: String,
firstPartyAddress: String
): PrivateThirdPartyEndpoint? {
val key = "${firstPartyAddress}_$thirdPartyAddress"
return Storage.thirdPartyAuthorization.get(key)?.let { auth ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ internal class PrivateThirdPartyEndpointTest {
val firstAddress = UUID.randomUUID().toString()
val thirdAddress = UUID.randomUUID().toString()

with(PrivateThirdPartyEndpoint.load(firstAddress, thirdAddress)!!) {
with(PrivateThirdPartyEndpoint.load(thirdAddress, firstAddress)!!) {
assertEquals(firstAddress, firstPartyEndpointAddress)
assertEquals(PDACertPath.PRIVATE_ENDPOINT.subjectPrivateAddress, address)
assertEquals(PDACertPath.PRIVATE_ENDPOINT, pda)
Expand Down

0 comments on commit 9455af4

Please sign in to comment.