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
8febc1e6
Commit
8febc1e6
authored
Sep 19, 2019
by
Greg Messner
Browse files
Added test for triggerHousekeeping() (#433).
parent
0a3911cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
8febc1e6
...
...
@@ -2932,18 +2932,15 @@ public class ProjectApi extends AbstractApi implements Constants {
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"access_requests"
,
userId
);
}
/**
* Start the Housekeeping task for a project.
*
* <pre>
* <code>GitLab Endpoint: POST /projects/:id/housekeeping</code>
* </pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @throws GitLabApiException if any exception occurs
*/
public
void
triggerHousekeeping
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
Form
formData
=
null
;
post
(
Response
.
Status
.
OK
,
formData
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"housekeeping"
);
}
/**
* Start the Housekeeping task for a project.
*
* <pre><code>GitLab Endpoint: POST /projects/:id/housekeeping</code></pre>
*
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
* @throws GitLabApiException if any exception occurs
*/
public
void
triggerHousekeeping
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
post
(
Response
.
Status
.
OK
,
(
Form
)
null
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"housekeeping"
);
}
}
src/test/java/org/gitlab4j/api/TestProjectApi.java
View file @
8febc1e6
...
...
@@ -855,4 +855,10 @@ public class TestProjectApi extends AbstractIntegrationTest {
Optional
<
ProjectFetches
>
statistics
=
gitLabApi
.
getProjectApi
().
getOptionalProjectStatistics
(
testProject
);
assertTrue
(
statistics
.
isPresent
());
}
@Test
public
void
testTriggerHousekeeping
()
throws
GitLabApiException
{
assertNotNull
(
testProject
);
gitLabApi
.
getProjectApi
().
triggerHousekeeping
(
testProject
);
}
}
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