plugin translation servlet

This commit is contained in:
Mohamed Karray
2018-10-20 14:40:03 +02:00
parent 3ac803ce82
commit 9cb661b460
13 changed files with 357 additions and 69 deletions

View File

@@ -52,7 +52,12 @@ public class ScmRequests {
setUsername(username);
setPassword(password);
return new ChangePasswordResponse<>(applyPUTRequest(RestUtil.REST_BASE_URL.resolve("users/"+userPathParam+"/password").toString(), VndMediaType.PASSWORD_OVERWRITE, TestData.createPasswordChangeJson(password,newPassword)), null);
}
@SuppressWarnings("unchecked")
public ModelResponse requestPluginTranslations(String language) {
Response response = applyGETRequest(RestUtil.BASE_URL.resolve("locales/" + language + "/plugins.json").toString());
return new ModelResponse(response, null);
}
/**
@@ -90,6 +95,11 @@ public class ScmRequests {
*/
private Response applyGETRequestWithQueryParams(String url, String params) {
LOG.info("GET {}", url);
if (username == null || password == null){
return RestAssured.given()
.when()
.get(url + params);
}
return RestAssured.given()
.auth().preemptive().basic(username, password)
.when()