morozov
08/19/2019, 3:03 PMinternal fun createRequestUrl(baseUrl: String, routePath: String): String {
val baseUri = Uri.parse(baseUrl)
return Uri.Builder()
.scheme(baseUri.scheme ?: "https")
.encodedAuthority(baseUri.authority ?: "")
.appendEncodedPath(routePath)
.build()
.toString()
}
But test fails:
assertThat(createRequestUrl("<https://google.com/myroute/>", API_AUTHORIZATIONS),
equalTo("<https://google.com/myroute/api/mandarine/v1/authorizations>"))
it doesn't add a myroute after the base url, he is clipped:
I think that the problem is in this line, but the alternative can't find:
.appendEncodedPath(routePath)