Skip to content

Instantly share code, notes, and snippets.

@ElderMael
Created January 12, 2014 01:54
Show Gist options
  • Save ElderMael/8379563 to your computer and use it in GitHub Desktop.
Save ElderMael/8379563 to your computer and use it in GitHub Desktop.
Trying to use Hamcrest Matchers in Scala
private def checkHttpStatus(response: Future[HttpResponse]) {
val statusCode = Await.result(response, 10 seconds).status
println(s"Status code: ${statusCode.intValue}")
assertThat(s"Expected 200 OK or 304 Not Modified, received ${statusCode.intValue}",
statusCode.intValue,
CoreMatchers.anyOf(CoreMatchers.equalTo(200), CoreMatchers.equalTo(304)))
}
@ElderMael
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment