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
56afbdf1
Commit
56afbdf1
authored
Feb 28, 2014
by
Greg Messner
Browse files
Consolidated tests.
parent
dc982127
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/test/java/com/messners/gitlab/api/TestCreateProjectAndMergeRequest.java
deleted
100644 → 0
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."
);
}
}
}
src/test/java/com/messners/gitlab/api/TestGitLabApi.java
View file @
56afbdf1
...
@@ -46,24 +46,4 @@ public class TestGitLabApi {
...
@@ -46,24 +46,4 @@ public class TestGitLabApi {
System
.
err
.
println
(
"Check TEST_HOST_URL and TEST_PRIVATE_TOKEN, they are probably not set."
);
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."
);
}
}
}
}
src/test/java/com/messners/gitlab/api/TestGitLabApiBeans.java
View file @
56afbdf1
...
@@ -15,7 +15,7 @@ import org.junit.Test;
...
@@ -15,7 +15,7 @@ import org.junit.Test;
public
class
TestGitLabApiBeans
{
public
class
TestGitLabApiBeans
{
private
static
JacksonJson
Config
jacksonJsonConfig
;
private
static
JacksonJson
jacksonJsonConfig
;
public
TestGitLabApiBeans
()
{
public
TestGitLabApiBeans
()
{
super
();
super
();
...
@@ -23,7 +23,7 @@ public class TestGitLabApiBeans {
...
@@ -23,7 +23,7 @@ public class TestGitLabApiBeans {
@BeforeClass
@BeforeClass
public
static
void
setup
()
{
public
static
void
setup
()
{
jacksonJsonConfig
=
new
JacksonJson
Config
();
jacksonJsonConfig
=
new
JacksonJson
();
}
}
@Test
@Test
...
...
src/test/java/com/messners/gitlab/api/TestGitLabApiEvents.java
View file @
56afbdf1
...
@@ -16,7 +16,7 @@ import com.messners.gitlab.api.webhook.PushEvent;
...
@@ -16,7 +16,7 @@ import com.messners.gitlab.api.webhook.PushEvent;
public
class
TestGitLabApiEvents
{
public
class
TestGitLabApiEvents
{
private
static
JacksonJson
Config
jacksonJsonConfig
;
private
static
JacksonJson
jacksonJsonConfig
;
public
TestGitLabApiEvents
()
{
public
TestGitLabApiEvents
()
{
super
();
super
();
...
@@ -24,7 +24,7 @@ public class TestGitLabApiEvents {
...
@@ -24,7 +24,7 @@ public class TestGitLabApiEvents {
@BeforeClass
@BeforeClass
public
static
void
setup
()
{
public
static
void
setup
()
{
jacksonJsonConfig
=
new
JacksonJson
Config
();
jacksonJsonConfig
=
new
JacksonJson
();
}
}
@Test
@Test
...
...
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