@Test public void associateProjectToQualityProfile_sends_POST_request() throws Exception { server.enqueue(new MockResponse()); Server underTest = newServerForUrl(this.server.url("").toString()); underTest.associateProjectToQualityProfile("foo", "bar", "baz"); RecordedRequest receivedRequest = server.takeRequest(); assertThat(receivedRequest.getMethod()).isEqualTo("POST"); assertThat(receivedRequest.getPath()).isEqualTo("/api/qualityprofiles/add_project"); assertThat(receivedRequest.getBody().readUtf8()).isEqualTo("project=foo&language=bar&qualityProfile=baz"); }
public void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName) { newHttpCall("/api/qualityprofiles/add_project") .setMethod(HttpMethod.POST) .setAdminCredentials() .setParam("project", projectKey) .setParam("language", languageKey) .setParam("qualityProfile", profileName) .execute(); }
Server { public void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName) { newHttpCall("/api/qualityprofiles/add_project") .setMethod(HttpMethod.POST) .setAdminCredentials() .setParam("project", projectKey) .setParam("language", languageKey) .setParam("qualityProfile", profileName) .execute(); } }
Server { public void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName) { newHttpCall("/api/qualityprofiles/add_project") .setMethod(HttpMethod.POST) .setAdminCredentials() .setParam("project", projectKey) .setParam("language", languageKey) .setParam("qualityProfile", profileName) .execute(); } Server(Locators locators, File home, Edition edition, Version version, HttpUrl url, int searchPort, @Nullable String clusterNodeName); }
Server { public void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName) { newHttpCall("/api/qualityprofiles/add_project") .setMethod(HttpMethod.POST) .setAdminCredentials() .setParam("project", projectKey) .setParam("language", languageKey) .setParam("qualityProfile", profileName) .execute(); } Server(Locators locators, File home, Edition edition, Version version, HttpUrl url, int searchPort, @Nullable String clusterNodeName); File getHome(); Edition getEdition(); String getUrl(); Version version(); @Deprecated File getLogs(); File getAppLogs(); File getWebLogs(); File getCeLogs(); File getEsLogs(); int getSearchPort(); Optional<String> getClusterNodeName(); Server restoreProfile(Location backup); void provisionProject(String projectKey, String projectName); @Deprecated String post(String relativePath, Map<String, Object> params); HttpCall newHttpCall(String relativePath); void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName); }
Server { public void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName) { newHttpCall("/api/qualityprofiles/add_project") .setMethod(HttpMethod.POST) .setAdminCredentials() .setParam("project", projectKey) .setParam("language", languageKey) .setParam("qualityProfile", profileName) .execute(); } Server(Locators locators, File home, Edition edition, Version version, HttpUrl url, int searchPort, @Nullable String clusterNodeName); File getHome(); Edition getEdition(); String getUrl(); Version version(); @Deprecated File getLogs(); File getAppLogs(); File getWebLogs(); File getCeLogs(); File getEsLogs(); int getSearchPort(); Optional<String> getClusterNodeName(); Server restoreProfile(Location backup); void provisionProject(String projectKey, String projectName); @Deprecated String post(String relativePath, Map<String, Object> params); HttpCall newHttpCall(String relativePath); void associateProjectToQualityProfile(String projectKey, String languageKey, String profileName); static final String ADMIN_LOGIN; static final String ADMIN_PASSWORD; }