@Override
  public List<QualityProfile> load(String projectKey) {
    StringBuilder url = new StringBuilder(WS_URL + "?project=").append(encodeForUrl(projectKey));
    return handleErrors(url, () -> String.format("Failed to load the quality profiles of project '%s'", projectKey), true);
  }
@Test
  public void load_tries_default_if_no_profiles_found_for_project() throws IOException {
    HttpException e = new HttpException("", 404, "{\"errors\":[{\"msg\":\"No project found with key 'foo'\"}]}");
    WsTestUtil.mockException(wsClient, "/api/qualityprofiles/search.protobuf?project=foo", e);
    WsTestUtil.mockStream(wsClient, "/api/qualityprofiles/search.protobuf?defaults=true", createStreamOfProfiles("qp"));

    underTest.load("foo");

    verifyCalledPath("/api/qualityprofiles/search.protobuf?project=foo");
    verifyCalledPath("/api/qualityprofiles/search.protobuf?defaults=true");
  }