public Repository getRepo(String serverUrl, String token, String project, String repoSlug) {
    HttpUrl url = buildUrl(serverUrl, format("/rest/api/1.0/projects/%s/repos/%s", project, repoSlug));
    return doGet(token, url, body -> buildGson().fromJson(body, Repository.class));
  }
@Test
  @UseDataProvider("expectedErrorMessageFromHttpNoJsonBody")
  public void fail_response_when_http_no_json_body(int responseCode, String body, String headerContent, String expectedErrorMessage) {
    server.enqueue(new MockResponse()
            .setHeader("Content-Type", headerContent)
            .setResponseCode(responseCode)
            .setBody(body));

    String serverUrl = server.url("/").toString();
    assertThatThrownBy(() -> underTest.getRepo(serverUrl, "token", "", ""))
            .isInstanceOf(IllegalArgumentException.class)
            .hasMessage(expectedErrorMessage);
  }