I have this little snippet: ``` val (_, _,...
# mockk
t
I have this little snippet:
Copy code
val (_, _, result) = myUrlString.httpPost()
            .header("Content-Type" to "application/json", "Authorization" to "Bearer $authToken")
            .body(jacksonObjectMapper().writeValueAsString(message))
            .responseString()

        if (result is Result.Failure) {
            val errorMessage = result.error.response.responseMessage

            throw BadRequestException(errorMessage)
        } else {
            return true
        }
d
I'd say to make an interface for the call and mock that...
t
turns out I was an idiot - Fuel requires any string that you make a call on to specify what protocol it’s going to be using (IE - “http://domain.com/“) and I didn’t include it in my test (I had “domain.com/“)
added the protocol to the beginning - test ran like a charm
👍🏼 1