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
f917e9f8
Commit
f917e9f8
authored
Dec 04, 2017
by
Greg Messner
Browse files
Now skips session tests if version is >= 10.2
parent
dce1deb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/TestGitLabSession.java
View file @
f917e9f8
...
...
@@ -5,6 +5,7 @@ import static org.junit.Assert.assertNotNull;
import
static
org
.
junit
.
Assume
.
assumeTrue
;
import
org.gitlab4j.api.GitLabApi.ApiVersion
;
import
org.gitlab4j.api.models.Version
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
...
...
@@ -60,6 +61,27 @@ public class TestGitLabSession {
problems
+=
"TEST_PRIVATE_TOKEN cannot be empty\n"
;
}
if
(
problems
.
isEmpty
())
{
String
savedVersion
=
null
;
try
{
GitLabApi
gitLabApi
=
new
GitLabApi
(
ApiVersion
.
V4
,
TEST_HOST_URL
,
TEST_PRIVATE_TOKEN
);
Version
version
=
gitLabApi
.
getVersion
();
savedVersion
=
version
.
getVersion
();
String
[]
parts
=
version
.
getVersion
().
split
(
"."
,
-
1
);
if
(
parts
.
length
==
3
)
{
if
(
Integer
.
parseInt
(
parts
[
0
])
<
10
||
(
Integer
.
parseInt
(
parts
[
0
])
==
10
&&
Integer
.
parseInt
(
parts
[
1
])
<
2
))
{
savedVersion
=
null
;
}
}
}
catch
(
Exception
e
)
{
}
if
(
savedVersion
!=
null
)
{
problems
+=
"GitLab version "
+
savedVersion
+
" does not support sessions\n"
;
}
}
if
(!
problems
.
isEmpty
())
{
System
.
err
.
print
(
problems
);
}
...
...
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