  @Test
  void testExceptionIsRaisedWhenContentTypeIsJsonAndPostDataTextIsNotJson() {

    HarRequest harRequest =
        new HarRequest()
            .withUrl(HTTP_URL)
            .withPostData(new HarPostData().withMimeType(MediaType.APPLICATION_JSON))
            ;
    Exception thrown =
        assertThrows(
            Exception.class, () -> newCodeRequest(harRequest), "Expected exception thrown");
    assertEquals("JSON validation failed", thrown.getMessage());
  }