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
593c89df
Commit
593c89df
authored
Oct 10, 2014
by
Mirko Friedenhagen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`assumeThat` not working as expected, throw an AssertionError when
we do not get an `401 Unauthorized` during `setup`.
parent
2b60bfd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
GitlabAPIT.java
src/test/java/org/gitlab/api/GitlabAPIT.java
+4
-4
No files found.
src/test/java/org/gitlab/api/GitlabAPIT.java
View file @
593c89df
package
org
.
gitlab
.
api
;
package
org
.
gitlab
.
api
;
import
org.gitlab.api.models.GitlabUser
;
import
org.gitlab.api.models.GitlabUser
;
import
static
org
.
hamcrest
.
CoreMatchers
.
is
;
import
org.junit.Assert
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.Test
;
...
@@ -13,7 +12,6 @@ import java.util.UUID;
...
@@ -13,7 +12,6 @@ import java.util.UUID;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assume
.
assumeNoException
;
import
static
org
.
junit
.
Assume
.
assumeNoException
;
import
static
org
.
junit
.
Assume
.
assumeThat
;
import
java.net.ConnectException
;
import
java.net.ConnectException
;
...
@@ -34,10 +32,12 @@ public class GitlabAPIT {
...
@@ -34,10 +32,12 @@ public class GitlabAPIT {
try
{
try
{
_api
.
dispatch
().
with
(
"login"
,
"INVALID"
).
with
(
"password"
,
rand
).
to
(
"session"
,
GitlabUser
.
class
);
_api
.
dispatch
().
with
(
"login"
,
"INVALID"
).
with
(
"password"
,
rand
).
to
(
"session"
,
GitlabUser
.
class
);
}
catch
(
ConnectException
e
)
{
}
catch
(
ConnectException
e
)
{
assumeNoException
(
"GITLAB not running on
localhost
, skipping..."
,
e
);
assumeNoException
(
"GITLAB not running on
'"
+
TEST_URL
+
"'
, skipping..."
,
e
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
final
String
message
=
e
.
getMessage
();
final
String
message
=
e
.
getMessage
();
assumeThat
(
message
,
is
(
"{\"message\":\"401 Unauthorized\"}"
));
if
(!
message
.
equals
(
"{\"message\":\"401 Unauthorized\"}"
))
{
throw
new
AssertionError
(
"Expected an unauthorized message"
,
e
);
}
}
}
}
}
...
...
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