refactor the integration test lib to use the index resource & add unit tests for autoComplete permission

This commit is contained in:
Mohamed Karray
2018-10-15 18:35:45 +02:00
parent e891ce9850
commit 356b84f4cd
7 changed files with 229 additions and 439 deletions

View File

@@ -203,12 +203,16 @@ public class TestData {
return JSON_BUILDER
.add("contact", "zaphod.beeblebrox@hitchhiker.com")
.add("description", "Heart of Gold")
.add("name", "HeartOfGold-" + repositoryType)
.add("name", getDefaultRepoName(repositoryType))
.add("archived", false)
.add("type", repositoryType)
.build().toString();
}
public static String getDefaultRepoName(String repositoryType) {
return "HeartOfGold-" + repositoryType;
}
public static String getGroupJson(String groupname , String desc) {
return JSON_BUILDER
.add("name", groupname)
@@ -216,10 +220,6 @@ public class TestData {
.build().toString();
}
public static URI getMeUrl() {
return RestUtil.createResourceUrl("me/");
}
public static URI getGroupsUrl() {
return RestUtil.createResourceUrl("groups/");
}
@@ -228,18 +228,6 @@ public class TestData {
return RestUtil.createResourceUrl("users/");
}
public static URI getUserUrl(String username) {
return getUsersUrl().resolve(username);
}
public static URI getUsersAutoCompleteUrl(String query ) {
return RestUtil.createResourceUrl("autocomplete/users?q="+query);
}
public static URI getGroupsAutoCompleteUrl(String query ) {
return RestUtil.createResourceUrl("autocomplete/groups?q="+query);
}
public static String createPasswordChangeJson(String oldPassword, String newPassword) {
return JSON_BUILDER
.add("oldPassword", oldPassword)