public void validateUrl(String serverUrl) {
    HttpUrl url = buildUrl(serverUrl, "/rest/api/1.0/repos");
    doGet("", url, body -> buildGson().fromJson(body, RepositoryList.class));
  }
@Test
  public void fail_validate_url_when_returning_non_json_payload_with_a_200_code() {
    server.enqueue(new MockResponse().setResponseCode(200)
      .setBody("this is not a json payload"));

    String serverUrl = server.url("/").toString();
    assertThatThrownBy(() -> underTest.validateUrl(serverUrl))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("Unexpected response from Bitbucket server");
    assertThat(String.join(", ", logTester.logs()))
      .contains("Unexpected response from Bitbucket server : [this is not a json payload]");
  }