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
2e63cae6
Commit
2e63cae6
authored
Jun 01, 2021
by
t.mucs
Browse files
Add merge_method to ProjectApi.updateProject()
parent
db8f9254
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
2e63cae6
...
@@ -1265,7 +1265,8 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -1265,7 +1265,8 @@ public class ProjectApi extends AbstractApi implements Constants {
.
withParam
(
"resolve_outdated_diff_discussions"
,
project
.
getResolveOutdatedDiffDiscussions
())
.
withParam
(
"resolve_outdated_diff_discussions"
,
project
.
getResolveOutdatedDiffDiscussions
())
.
withParam
(
"packages_enabled"
,
project
.
getPackagesEnabled
())
.
withParam
(
"packages_enabled"
,
project
.
getPackagesEnabled
())
.
withParam
(
"build_git_strategy"
,
project
.
getBuildGitStrategy
())
.
withParam
(
"build_git_strategy"
,
project
.
getBuildGitStrategy
())
.
withParam
(
"build_coverage_regex"
,
project
.
getBuildCoverageRegex
());
.
withParam
(
"build_coverage_regex"
,
project
.
getBuildCoverageRegex
())
.
withParam
(
"merge_method"
,
project
.
getMergeMethod
())
if
(
isApiVersion
(
ApiVersion
.
V3
))
{
if
(
isApiVersion
(
ApiVersion
.
V3
))
{
formData
.
withParam
(
"visibility_level"
,
project
.
getVisibilityLevel
());
formData
.
withParam
(
"visibility_level"
,
project
.
getVisibilityLevel
());
...
...
src/test/java/org/gitlab4j/api/TestProjectApi.java
View file @
2e63cae6
...
@@ -235,7 +235,8 @@ public class TestProjectApi extends AbstractIntegrationTest {
...
@@ -235,7 +235,8 @@ public class TestProjectApi extends AbstractIntegrationTest {
.
withWikiEnabled
(
true
)
.
withWikiEnabled
(
true
)
.
withSnippetsEnabled
(
true
)
.
withSnippetsEnabled
(
true
)
.
withVisibility
(
Visibility
.
PUBLIC
)
.
withVisibility
(
Visibility
.
PUBLIC
)
.
withTagList
(
Arrays
.
asList
(
"tag1"
,
"tag2"
));
.
withTagList
(
Arrays
.
asList
(
"tag1"
,
"tag2"
))
.
withMergeMethod
(
Project
.
MergeMethod
.
MERGE
)
Project
newProject
=
gitLabApi
.
getProjectApi
().
createProject
(
project
);
Project
newProject
=
gitLabApi
.
getProjectApi
().
createProject
(
project
);
assertNotNull
(
newProject
);
assertNotNull
(
newProject
);
...
@@ -247,6 +248,7 @@ public class TestProjectApi extends AbstractIntegrationTest {
...
@@ -247,6 +248,7 @@ public class TestProjectApi extends AbstractIntegrationTest {
assertEquals
(
project
.
getSnippetsEnabled
(),
newProject
.
getSnippetsEnabled
());
assertEquals
(
project
.
getSnippetsEnabled
(),
newProject
.
getSnippetsEnabled
());
assertEquals
(
project
.
getTagList
(),
newProject
.
getTagList
());
assertEquals
(
project
.
getTagList
(),
newProject
.
getTagList
());
assertTrue
(
Visibility
.
PUBLIC
==
newProject
.
getVisibility
()
||
Boolean
.
TRUE
==
newProject
.
getPublic
());
assertTrue
(
Visibility
.
PUBLIC
==
newProject
.
getVisibility
()
||
Boolean
.
TRUE
==
newProject
.
getPublic
());
assertEquals
(
Project
.
MergeMethod
.
MERGE
,
newProject
.
getMergeMethod
());
project
=
new
Project
()
project
=
new
Project
()
.
withId
(
newProject
.
getId
())
.
withId
(
newProject
.
getId
())
...
@@ -256,7 +258,8 @@ public class TestProjectApi extends AbstractIntegrationTest {
...
@@ -256,7 +258,8 @@ public class TestProjectApi extends AbstractIntegrationTest {
.
withMergeRequestsEnabled
(
false
)
.
withMergeRequestsEnabled
(
false
)
.
withWikiEnabled
(
false
)
.
withWikiEnabled
(
false
)
.
withSnippetsEnabled
(
false
)
.
withSnippetsEnabled
(
false
)
.
withVisibility
(
Visibility
.
PRIVATE
);
.
withVisibility
(
Visibility
.
PRIVATE
)
.
withMergeMethod
(
Project
.
MergeMethod
.
REBASE_MERGE
)
Project
updatedProject
=
gitLabApi
.
getProjectApi
().
updateProject
(
project
);
Project
updatedProject
=
gitLabApi
.
getProjectApi
().
updateProject
(
project
);
assertNotNull
(
updatedProject
);
assertNotNull
(
updatedProject
);
...
@@ -267,6 +270,7 @@ public class TestProjectApi extends AbstractIntegrationTest {
...
@@ -267,6 +270,7 @@ public class TestProjectApi extends AbstractIntegrationTest {
assertEquals
(
project
.
getWikiEnabled
(),
updatedProject
.
getWikiEnabled
());
assertEquals
(
project
.
getWikiEnabled
(),
updatedProject
.
getWikiEnabled
());
assertEquals
(
project
.
getSnippetsEnabled
(),
updatedProject
.
getSnippetsEnabled
());
assertEquals
(
project
.
getSnippetsEnabled
(),
updatedProject
.
getSnippetsEnabled
());
assertTrue
(
Visibility
.
PRIVATE
==
updatedProject
.
getVisibility
()
||
Boolean
.
FALSE
==
updatedProject
.
getPublic
());
assertTrue
(
Visibility
.
PRIVATE
==
updatedProject
.
getVisibility
()
||
Boolean
.
FALSE
==
updatedProject
.
getPublic
());
assertEquals
(
Project
.
MergeMethod
.
REBASE_MERGE
,
updatedProject
.
getMergeMethod
());
}
}
@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