Skip to content

Commit

Permalink
update tests for new wording
Browse files Browse the repository at this point in the history
  • Loading branch information
johnduffell committed Oct 31, 2018
1 parent cec94fe commit bf4c07c
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -72,13 +72,13 @@ class RestRequestMakerTest extends AsyncFlatSpec {
"convertResponseToCaseClass" should "return a left[String] for an unsuccessful response code" in {
val response = constructTestResponse(500)
val either = RestRequestMaker.httpIsSuccessful(response)
assert(either == GenericError("Request to Zuora was unsuccessful"))
assert(either == GenericError("HTTP request was unsuccessful"))
}

it should "return a left[String] if the body of a successful response cannot be de-serialized to that case class" in {
val either = RestRequestMaker.toResult[BasicAccountInfo](validZuoraNoOtherFields)
val result = either.mapFailure(first => GenericError(first.message.split(":")(0)))
assert(result == GenericError("Error when converting Zuora response to case class"))
assert(result == GenericError("Error when converting JSON response to case class"))
}

it should "return a right[T] if the body of a successful response deserializes to T" in {
Expand Down

0 comments on commit bf4c07c

Please sign in to comment.