Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
e0f180a6
Commit
e0f180a6
authored
Oct 19, 2019
by
Greg Messner
Browse files
Cleaned up initialization code.
parent
9e489673
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/TestGroupApi.java
View file @
e0f180a6
...
@@ -13,7 +13,6 @@ import java.util.stream.Stream;
...
@@ -13,7 +13,6 @@ import java.util.stream.Stream;
import
javax.ws.rs.core.Response
;
import
javax.ws.rs.core.Response
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.AccessRequest
;
import
org.gitlab4j.api.models.AccessRequest
;
import
org.gitlab4j.api.models.Group
;
import
org.gitlab4j.api.models.Group
;
...
@@ -41,7 +40,6 @@ import org.junit.experimental.categories.Category;
...
@@ -41,7 +40,6 @@ import org.junit.experimental.categories.Category;
public
class
TestGroupApi
extends
AbstractIntegrationTest
{
public
class
TestGroupApi
extends
AbstractIntegrationTest
{
// The following needs to be set to your test repository
// The following needs to be set to your test repository
private
static
final
String
TEST_USERNAME
=
HelperUtils
.
getProperty
(
USERNAME_KEY
);
private
static
final
String
TEST_GROUP
=
HelperUtils
.
getProperty
(
GROUP_KEY
);
private
static
final
String
TEST_GROUP
=
HelperUtils
.
getProperty
(
GROUP_KEY
);
private
static
final
String
TEST_GROUP_MEMBER_USERNAME
=
HelperUtils
.
getProperty
(
GROUP_MEMBER_USERNAME_KEY
);
private
static
final
String
TEST_GROUP_MEMBER_USERNAME
=
HelperUtils
.
getProperty
(
GROUP_MEMBER_USERNAME_KEY
);
private
static
final
String
TEST_REQUEST_ACCESS_USERNAME
=
HelperUtils
.
getProperty
(
TEST_REQUEST_ACCESS_USERNAME_KEY
);
private
static
final
String
TEST_REQUEST_ACCESS_USERNAME
=
HelperUtils
.
getProperty
(
TEST_REQUEST_ACCESS_USERNAME_KEY
);
...
@@ -61,18 +59,12 @@ public class TestGroupApi extends AbstractIntegrationTest {
...
@@ -61,18 +59,12 @@ public class TestGroupApi extends AbstractIntegrationTest {
gitLabApi
=
baseTestSetup
();
gitLabApi
=
baseTestSetup
();
String
problems
=
""
;
String
problems
=
""
;
if
(
TEST_USERNAME
==
null
||
TEST_USERNAME
.
trim
().
isEmpty
())
{
if
(
gitLabApi
!=
null
)
{
problems
+=
"TEST_USER_NAME cannot be empty\n"
;
Optional
<
Group
>
group
=
gitLabApi
.
getGroupApi
().
getOptionalGroup
(
TEST_GROUP
);
}
if
(
group
.
isPresent
())
{
testGroup
=
group
.
get
();
if
(
gitLabApi
!=
null
&&
problems
.
isEmpty
())
{
}
else
{
problems
+=
"Problem fetching test group\n"
;
gitLabApi
=
new
GitLabApi
(
ApiVersion
.
V4
,
TEST_HOST_URL
,
TEST_PRIVATE_TOKEN
);
try
{
List
<
Group
>
groups
=
gitLabApi
.
getGroupApi
().
getGroups
(
TEST_GROUP
);
testGroup
=
groups
.
get
(
0
);
}
catch
(
GitLabApiException
gle
)
{
problems
+=
"Problem fetching test group, error="
+
gle
.
getMessage
()
+
"\n"
;
}
}
if
(
TEST_GROUP_MEMBER_USERNAME
!=
null
&&
TEST_GROUP_MEMBER_USERNAME
.
length
()
>
0
)
{
if
(
TEST_GROUP_MEMBER_USERNAME
!=
null
&&
TEST_GROUP_MEMBER_USERNAME
.
length
()
>
0
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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