Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
56afbdf1
Commit
56afbdf1
authored
11 years ago
by
Greg Messner
Browse files
Options
Download
Email Patches
Plain Diff
Consolidated tests.
parent
dc982127
main
5.0.x
5.0.x.jdk17
6.x
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/test/java/com/messners/gitlab/api/TestCreateProjectAndMergeRequest.java
+0
-44
...messners/gitlab/api/TestCreateProjectAndMergeRequest.java
src/test/java/com/messners/gitlab/api/TestGitLabApi.java
+0
-20
src/test/java/com/messners/gitlab/api/TestGitLabApi.java
src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java
+2
-2
...test/java/com/messners/gitlab/api/TestGitLabApiBeans.java
src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java
+2
-2
...est/java/com/messners/gitlab/api/TestGitLabApiEvents.java
with
4 additions
and
68 deletions
+4
-68
src/test/java/com/messners/gitlab/api/TestCreateProjectAndMergeRequest.java
deleted
100644 → 0
+
0
-
44
View file @
dc982127
package
com.messners.gitlab.api
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
public
class
TestCreateProjectAndMergeRequest
{
// The following needs to be set to your test repository
private
static
final
String
TEST_HOST_URL
=
"https://your.gitlab.host.url"
;
private
static
final
String
TEST_PRIVATE_TOKEN
=
"YOUR PRIVATE TOKEN"
;
private
static
GitLabApi
gitLabApi
;
public
TestCreateProjectAndMergeRequest
()
{
super
();
}
@BeforeClass
public
static
void
setup
()
{
gitLabApi
=
new
GitLabApi
(
TEST_HOST_URL
,
TEST_PRIVATE_TOKEN
);
}
@Test
public
void
testCreateProject
()
{
try
{
Project
newProject
=
new
Project
();
newProject
.
setName
(
"test-gitlab-api-project"
);
Project
project
=
gitLabApi
.
createProject
(
newProject
);
assertTrue
(
project
!=
null
);
assertTrue
(
project
.
getName
().
equals
(
newProject
.
getName
()));
gitLabApi
.
deleteProject
(
project
);
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Check TEST_HOST_URL and TEST_PRIVATE_TOKEN, they are probably not set."
);
}
}
}
This diff is collapsed.
Click to expand it.
src/test/java/com/messners/gitlab/api/TestGitLabApi.java
+
0
-
20
View file @
56afbdf1
...
...
@@ -46,24 +46,4 @@ public class TestGitLabApi {
System
.
err
.
println
(
"Check TEST_HOST_URL and TEST_PRIVATE_TOKEN, they are probably not set."
);
}
}
@Test
public
void
testOwnedProjectsProject
()
{
try
{
List
<
Project
>
projects
=
gitLabApi
.
getOwnedProjects
();
assertTrue
(
projects
!=
null
);
Project
ownedProject
=
projects
.
get
(
0
);
assertTrue
(
ownedProject
!=
null
);
Project
project
=
gitLabApi
.
getProject
(
ownedProject
.
getId
());
assertTrue
(
project
!=
null
);
assertTrue
(
ownedProject
.
getId
().
equals
(
project
.
getId
()));
}
catch
(
Exception
e
)
{
System
.
err
.
println
(
"Check TEST_HOST_URL and TEST_PRIVATE_TOKEN, they are probably not set."
);
}
}
}
This diff is collapsed.
Click to expand it.
src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java
+
2
-
2
View file @
56afbdf1
...
...
@@ -15,7 +15,7 @@ import org.junit.Test;
public
class
TestGitLabApiBeans
{
private
static
JacksonJson
Config
jacksonJsonConfig
;
private
static
JacksonJson
jacksonJsonConfig
;
public
TestGitLabApiBeans
()
{
super
();
...
...
@@ -23,7 +23,7 @@ public class TestGitLabApiBeans {
@BeforeClass
public
static
void
setup
()
{
jacksonJsonConfig
=
new
JacksonJson
Config
();
jacksonJsonConfig
=
new
JacksonJson
();
}
@Test
...
...
This diff is collapsed.
Click to expand it.
src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java
+
2
-
2
View file @
56afbdf1
...
...
@@ -16,7 +16,7 @@ import com.messners.gitlab.api.webhook.PushEvent;
public
class
TestGitLabApiEvents
{
private
static
JacksonJson
Config
jacksonJsonConfig
;
private
static
JacksonJson
jacksonJsonConfig
;
public
TestGitLabApiEvents
()
{
super
();
...
...
@@ -24,7 +24,7 @@ public class TestGitLabApiEvents {
@BeforeClass
public
static
void
setup
()
{
jacksonJsonConfig
=
new
JacksonJson
Config
();
jacksonJsonConfig
=
new
JacksonJson
();
}
@Test
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets