@Test
  public void serializeHandlesException() throws IOException {
    // given
    thrown.expect(RuntimeException.class);
    thrown.expectMessage(
        "Exception while serializing verification to JSON with value {"
            + System.getProperty("line.separator")
            + "  \"httpRequest\" : { },"
            + System.getProperty("line.separator")
            + "  \"times\" : {"
            + System.getProperty("line.separator")
            + "    \"count\" : 1,"
            + System.getProperty("line.separator")
            + "    \"exact\" : false"
            + System.getProperty("line.separator")
            + "  }"
            + System.getProperty("line.separator")
            + "}");
    // and
    when(objectMapper.writerWithDefaultPrettyPrinter()).thenReturn(objectWriter);
    when(objectWriter.writeValueAsString(any(VerificationDTO.class)))
        .thenThrow(new RuntimeException("TEST EXCEPTION"));

    // when
    verificationSerializer.serialize(new Verification());
  }
  @Test
  public void serialize() throws IOException {
    // given
    when(objectMapper.writerWithDefaultPrettyPrinter()).thenReturn(objectWriter);

    // when
    verificationSerializer.serialize(fullVerification);

    // then
    verify(objectMapper).writerWithDefaultPrettyPrinter();
    verify(objectWriter).writeValueAsString(fullVerificationDTO);
  }