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
b404e8a7
Unverified
Commit
b404e8a7
authored
Apr 12, 2023
by
Gautier de Saint Martin Lacaze
Committed by
GitHub
Apr 12, 2023
Browse files
Merge pull request #947 from jmini/move-to-jakarta
Replace javax package by jakarta package
parents
4289c1f9
1995a3f2
Changes
92
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/gitlab4j/api/TestMergeRequestDiscussionsApi.java
View file @
b404e8a7
...
...
@@ -11,7 +11,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.MultivaluedMap
;
import
ja
karta
.ws.rs.core.MultivaluedMap
;
import
org.gitlab4j.api.models.Discussion
;
import
org.junit.jupiter.api.BeforeEach
;
...
...
src/test/java/org/gitlab4j/api/TestProjectApi.java
View file @
b404e8a7
...
...
@@ -36,7 +36,7 @@ import java.util.Map;
import
java.util.Optional
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.AccessRequest
;
...
...
src/test/java/org/gitlab4j/api/TestReleaseLinksApi.java
0 → 100644
View file @
b404e8a7
package
org.gitlab4j.api
;
import
static
org
.
gitlab4j
.
api
.
JsonUtils
.
compareJson
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertNotNull
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertTrue
;
import
static
org
.
mockito
.
ArgumentMatchers
.
any
;
import
static
org
.
mockito
.
Mockito
.
when
;
import
static
org
.
mockito
.
MockitoAnnotations
.
openMocks
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
jakarta.ws.rs.core.MultivaluedMap
;
import
org.gitlab4j.api.models.Link
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.mockito.ArgumentCaptor
;
import
org.mockito.Captor
;
import
org.mockito.Mock
;
import
org.mockito.Mockito
;
public
class
TestReleaseLinksApi
implements
Constants
{
@Mock
private
GitLabApi
gitLabApi
;
@Mock
private
GitLabApiClient
gitLabApiClient
;
@Captor
private
ArgumentCaptor
<
MultivaluedMap
<
String
,
String
>>
attributeCaptor
;
private
MockResponse
response
;
@BeforeEach
public
void
setUp
()
throws
Exception
{
openMocks
(
this
);
}
@Test
public
void
testGetLinks
()
throws
Exception
{
initGetLinks
();
List
<
Link
>
result
=
new
ReleaseLinksApi
(
gitLabApi
).
getLinks
(
6L
,
"v1.0"
);
assertNotNull
(
result
);
assertTrue
(
compareJson
(
result
,
"links.json"
));
}
@Test
public
void
testGetLinksByPager
()
throws
Exception
{
initGetLinks
();
Pager
<
Link
>
pager
=
new
ReleaseLinksApi
(
gitLabApi
).
getLinks
(
6L
,
"v1.0"
,
20
);
assertNotNull
(
pager
);
assertTrue
(
compareJson
(
pager
.
all
(),
"links.json"
));
}
@Test
public
void
testGetLinksByStream
()
throws
Exception
{
initGetLinks
();
Stream
<
Link
>
stream
=
new
ReleaseLinksApi
(
gitLabApi
).
getLinksStream
(
6L
,
"v1.0"
);
assertNotNull
(
stream
);
List
<
Link
>
list
=
stream
.
collect
(
Collectors
.
toList
());
assertTrue
(
compareJson
(
list
,
"links.json"
));
}
private
void
initGetLinks
()
throws
Exception
,
IOException
{
response
=
new
MockResponse
(
Link
.
class
,
null
,
"links.json"
);
when
(
gitLabApi
.
getApiClient
()).
thenReturn
(
gitLabApiClient
);
when
(
gitLabApiClient
.
validateSecretToken
(
any
())).
thenReturn
(
true
);
when
(
gitLabApiClient
.
get
(
attributeCaptor
.
capture
(),
Mockito
.<
Object
>
any
())).
thenReturn
(
response
);
}
}
src/test/java/org/gitlab4j/api/TestSnippetDiscussionsApi.java
View file @
b404e8a7
...
...
@@ -11,7 +11,7 @@ import java.util.List;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.MultivaluedMap
;
import
ja
karta
.ws.rs.core.MultivaluedMap
;
import
org.gitlab4j.api.models.Discussion
;
import
org.junit.jupiter.api.BeforeEach
;
...
...
src/test/java/org/gitlab4j/api/TestStreams.java
View file @
b404e8a7
...
...
@@ -14,7 +14,7 @@ import static org.mockito.MockitoAnnotations.openMocks;
import
java.util.List
;
import
java.util.stream.Stream
;
import
ja
vax
.ws.rs.core.MultivaluedMap
;
import
ja
karta
.ws.rs.core.MultivaluedMap
;
import
org.gitlab4j.api.models.User
;
import
org.junit.jupiter.api.BeforeAll
;
...
...
src/test/java/org/gitlab4j/api/TestUnitMergeRequestApi.java
View file @
b404e8a7
...
...
@@ -9,7 +9,7 @@ import static org.mockito.MockitoAnnotations.openMocks;
import
java.util.Collections
;
import
ja
vax
.ws.rs.core.MultivaluedMap
;
import
ja
karta
.ws.rs.core.MultivaluedMap
;
import
org.gitlab4j.api.models.MergeRequest
;
import
org.junit.jupiter.api.BeforeEach
;
...
...
src/test/java/org/gitlab4j/api/TestUserApi.java
View file @
b404e8a7
...
...
@@ -15,7 +15,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Optional
;
import
ja
vax
.ws.rs.core.Response
;
import
ja
karta
.ws.rs.core.Response
;
import
org.gitlab4j.api.models.AccessLevel
;
import
org.gitlab4j.api.models.Email
;
...
...
src/test/resources/org/gitlab4j/api/job.json
View file @
b404e8a7
...
...
@@ -38,6 +38,7 @@
"web_url"
:
"https://example.com/foo/bar/-/jobs/7"
,
"allow_failure"
:
false
,
"duration"
:
0.465
,
"queued_duration"
:
0.010
,
"user"
:
{
"avatar_url"
:
"http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon"
,
"created_at"
:
"2015-12-21T13:14:24.077Z"
,
...
...
src/test/resources/org/gitlab4j/api/links.json
0 → 100644
View file @
b404e8a7
[
{
"id"
:
2
,
"name"
:
"awesome-v0.2.msi"
,
"url"
:
"http://192.168.10.15:3000/msi"
,
"external"
:
true
,
"link_type"
:
"other"
},
{
"id"
:
1
,
"name"
:
"awesome-v0.2.dmg"
,
"url"
:
"http://192.168.10.15:3000"
,
"external"
:
true
,
"link_type"
:
"other"
}
]
\ No newline at end of file
src/test/resources/org/gitlab4j/api/merge-request-event.json
View file @
b404e8a7
...
...
@@ -47,8 +47,11 @@
"title"
:
"MS-Viewport"
,
"created_at"
:
"2013-12-03T17:23:34Z"
,
"updated_at"
:
"2013-12-03T17:23:34Z"
,
"milestone_id"
:
1
,
"state"
:
"opened"
,
"blocking_discussions_resolved"
:
true
,
"work_in_progress"
:
false
,
"first_contribution"
:
true
,
"merge_status"
:
"unchecked"
,
"target_project_id"
:
14
,
"description"
:
""
,
...
...
@@ -95,7 +98,22 @@
"email"
:
"gitlabdev@dv6700.(none)"
}
},
"action"
:
"open"
"labels"
:
[
{
"id"
:
206
,
"title"
:
"API"
,
"color"
:
"#ffffff"
,
"project_id"
:
14
,
"created_at"
:
"2013-12-03T17:15:43Z"
,
"updated_at"
:
"2013-12-03T17:15:43Z"
,
"template"
:
false
,
"description"
:
"API related issues"
,
"type"
:
"ProjectLabel"
,
"group_id"
:
41
}
],
"action"
:
"open"
,
"detailed_merge_status"
:
"mergeable"
},
"labels"
:
[
{
...
...
src/test/resources/org/gitlab4j/api/pipeline-event.json
View file @
b404e8a7
...
...
@@ -16,6 +16,7 @@
"created_at"
:
"2016-08-12T15:23:28Z"
,
"finished_at"
:
"2016-08-12T15:26:29Z"
,
"duration"
:
63
,
"queued_duration"
:
0.010
,
"variables"
:
[
{
"key"
:
"NESTOR_PROD_ENVIRONMENT"
,
...
...
src/test/resources/org/gitlab4j/api/pipeline.json
View file @
b404e8a7
...
...
@@ -18,6 +18,7 @@
"updated_at"
:
"2016-08-11T11:32:35.169Z"
,
"finished_at"
:
"2016-08-11T11:32:35.145Z"
,
"coverage"
:
"30.0"
,
"queued_duration"
:
0.010
,
"detailed_status"
:
{
"icon"
:
"status_pending"
,
"text"
:
"pending"
,
...
...
@@ -28,4 +29,4 @@
"details_path"
:
"/gitlab4j/test-project/pipelines/66"
,
"favicon"
:
"/assets/ci_favicons/favicon_status_pending-5bdf338420e5221ca24353b6bff1c9367189588750632e9a871b7af09ff6a2ae.png"
}
}
\ No newline at end of file
}
Prev
1
2
3
4
5
Next
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