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
dave08
06/10/2018, 4:52 PM
I'd say to make an interface for the call and mock that...
t
thatadamedwards
06/11/2018, 3:47 PM
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/“)
thatadamedwards
06/11/2018, 3:47 PM
added the protocol to the beginning - test ran like a charm