@Test
public void testToString() {

  ErrorMessage errorMessage =
      new ErrorMessage(new IllegalStateException("illegal state"),
          SERVICE_UNAVAILABLE.getStatus());
  assertEquals("{\n"
      + "  \"error\": {\n"
      + "    \"reason\": \"There was internal problem at backend\",\n"
      + "    \"details\": \"illegal state\",\n"
      + "    \"type\": \"IllegalStateException\"\n"
      + "  },\n"
      + "  \"status\": 503\n"
      + "}", errorMessage.toString());
}