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
f35b1c44
Commit
f35b1c44
authored
Mar 08, 2020
by
Greg Messner
Browse files
Cleaned up some things related to AutoClosable
parent
d1f22d8c
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GitLabApi.java
View file @
f35b1c44
package
org.gitlab4j.api
;
import
java.io.Closeable
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
...
...
src/test/java/org/gitlab4j/api/TestAccessToken.java
View file @
f35b1c44
...
...
@@ -68,5 +68,7 @@ public class TestAccessToken extends AbstractIntegrationTest {
System
.
out
.
format
(
"tokenType: %s, version=%s, revision=%s%n"
,
TokenType
.
ACCESS
,
gitLabApi
.
getIgnoreCertificateErrors
(),
version
.
getVersion
(),
version
.
getRevision
());
assertNotNull
(
version
.
getVersion
());
assertNotNull
(
version
.
getRevision
());
gitLabApi
.
close
();
}
}
src/test/java/org/gitlab4j/api/TestAvatarUpload.java
View file @
f35b1c44
...
...
@@ -82,6 +82,8 @@ public class TestAvatarUpload extends AbstractIntegrationTest {
Project
updatedProject
=
gitLabApi
.
getProjectApi
().
setProjectAvatar
(
testProject
.
getId
(),
avatarFile
);
assertNotNull
(
updatedProject
);
assertTrue
(
updatedProject
.
getAvatarUrl
().
endsWith
(
AVATAR_FILENAME
));
gitLabApi
.
close
();
}
@Test
...
...
src/test/java/org/gitlab4j/api/TestFileUpload.java
View file @
f35b1c44
...
...
@@ -90,5 +90,7 @@ public class TestFileUpload extends AbstractIntegrationTest {
File
fileToUpload
=
new
File
(
"README.md"
);
FileUpload
fileUpload
=
gitLabApi
.
getProjectApi
().
uploadFile
(
project
.
getId
(),
fileToUpload
,
null
);
assertNotNull
(
fileUpload
);
gitLabApi
.
close
();
}
}
src/test/java/org/gitlab4j/api/TestGitLabApi.java
View file @
f35b1c44
...
...
@@ -69,5 +69,7 @@ public class TestGitLabApi extends AbstractIntegrationTest {
System
.
out
.
format
(
"version=%s, revision=%s%n"
,
version
.
getVersion
(),
version
.
getRevision
());
assertNotNull
(
version
.
getVersion
());
assertNotNull
(
version
.
getRevision
());
gitLabApi
.
close
();
}
}
src/test/java/org/gitlab4j/api/TestIgnoreCertificateErrors.java
View file @
f35b1c44
...
...
@@ -85,6 +85,7 @@ public class TestIgnoreCertificateErrors implements PropertyConstants {
System
.
out
.
format
(
"ignoreCertErrors: %b, version=%s, revision=%s%n"
,
gitLabApi
.
getIgnoreCertificateErrors
(),
version
.
getVersion
(),
version
.
getRevision
());
assertNotNull
(
version
.
getVersion
());
assertNotNull
(
version
.
getRevision
());
gitLabApi
.
close
();
gitLabApi
=
new
GitLabApi
(
ApiVersion
.
V4
,
TEST_HOST_URL
,
TEST_PRIVATE_TOKEN
);
gitLabApi
.
setIgnoreCertificateErrors
(
true
);
...
...
@@ -102,5 +103,7 @@ public class TestIgnoreCertificateErrors implements PropertyConstants {
System
.
out
.
format
(
"ignoreCertErrors: %b, version=%s, revision=%s%n"
,
gitLabApi
.
getIgnoreCertificateErrors
(),
version
.
getVersion
(),
version
.
getRevision
());
assertNotNull
(
version
.
getVersion
());
assertNotNull
(
version
.
getRevision
());
gitLabApi
.
close
();
}
}
src/test/java/org/gitlab4j/api/TestProjectApi.java
View file @
f35b1c44
...
...
@@ -196,6 +196,7 @@ public class TestProjectApi extends AbstractIntegrationTest {
GitLabApi
gitLabApi
=
new
GitLabApi
(
TEST_HOST_URL
,
""
);
List
<
Project
>
projects
=
gitLabApi
.
getProjectApi
().
getProjects
(
1
,
1
);
assertTrue
(
projects
!=
null
);
gitLabApi
.
close
();
}
@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