mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 15:05:44 +01:00
refactor the integration test lib to use the index resource & add unit tests for autoComplete permission
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user