Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
b22fb80a
Commit
b22fb80a
authored
Sep 02, 2016
by
zaky
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/timols/java-gitlab-api
Conflicts: src/test/java/org/gitlab/api/GitlabAPITest.java
parents
47a049b8
1040100a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
1 deletion
+34
-1
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+12
-1
GitlabAPITest.java
src/test/java/org/gitlab/api/GitlabAPITest.java
+22
-0
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
b22fb80a
...
...
@@ -343,7 +343,18 @@ public class GitlabAPI {
}
public
GitlabGroup
getGroup
(
Integer
groupId
)
throws
IOException
{
String
tailUrl
=
GitlabGroup
.
URL
+
"/"
+
groupId
;
return
getGroup
(
groupId
.
toString
());
}
/**
* Get a group by path
*
* @param path Path of the group
* @return
* @throws IOException
*/
public
GitlabGroup
getGroup
(
String
path
)
throws
IOException
{
String
tailUrl
=
GitlabGroup
.
URL
+
"/"
+
path
;
return
retrieve
().
to
(
tailUrl
,
GitlabGroup
.
class
);
}
...
...
src/test/java/org/gitlab/api/GitlabAPITest.java
View file @
b22fb80a
...
...
@@ -2,6 +2,7 @@ package org.gitlab.api;
import
org.gitlab.api.models.GitlabBuildVariable
;
import
org.gitlab.api.models.GitlabProject
;
import
org.gitlab.api.models.GitlabGroup
;
import
org.gitlab.api.models.GitlabUser
;
import
org.junit.Before
;
import
org.junit.Ignore
;
...
...
@@ -166,6 +167,27 @@ public class GitlabAPITest {
}
@Test
public
void
testGetGroupByPath
()
throws
IOException
{
// Given
String
name
=
"groupName"
;
String
path
=
"groupPath"
;
GitlabGroup
originalGroup
=
api
.
createGroup
(
name
,
path
);
// When
GitlabGroup
group
=
api
.
getGroup
(
path
);
// Then:
assertNotNull
(
group
);
assertEquals
(
originalGroup
.
getId
(),
group
.
getId
());
assertEquals
(
originalGroup
.
getName
(),
group
.
getName
());
assertEquals
(
originalGroup
.
getPath
(),
group
.
getPath
());
// Cleanup
api
.
deleteGroup
(
group
.
getId
());
}
private
String
randVal
(
String
postfix
)
{
return
rand
+
"_"
+
postfix
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment