Skip to content

Commit 8febc1e

Browse files
committed
Added test for triggerHousekeeping() (#433).
1 parent 0a3911c commit 8febc1e

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/main/java/org/gitlab4j/api/ProjectApi.java

+11-14
Original file line numberDiff line numberDiff line change
@@ -2932,18 +2932,15 @@ public void denyAccessRequest(Object projectIdOrPath, Integer userId) throws Git
29322932
"projects", getProjectIdOrPath(projectIdOrPath), "access_requests", userId);
29332933
}
29342934

2935-
/**
2936-
* Start the Housekeeping task for a project.
2937-
*
2938-
* <pre>
2939-
* <code>GitLab Endpoint: POST /projects/:id/housekeeping</code>
2940-
* </pre>
2941-
*
2942-
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
2943-
* @throws GitLabApiException if any exception occurs
2944-
*/
2945-
public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException {
2946-
Form formData = null;
2947-
post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "housekeeping");
2948-
}
2935+
/**
2936+
* Start the Housekeeping task for a project.
2937+
*
2938+
* <pre><code>GitLab Endpoint: POST /projects/:id/housekeeping</code></pre>
2939+
*
2940+
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
2941+
* @throws GitLabApiException if any exception occurs
2942+
*/
2943+
public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException {
2944+
post(Response.Status.OK, (Form) null, "projects", getProjectIdOrPath(projectIdOrPath), "housekeeping");
2945+
}
29492946
}

src/test/java/org/gitlab4j/api/TestProjectApi.java

+6
Original file line numberDiff line numberDiff line change
@@ -855,4 +855,10 @@ public void testGetProjectStatistics() throws GitLabApiException {
855855
Optional<ProjectFetches> statistics = gitLabApi.getProjectApi().getOptionalProjectStatistics(testProject);
856856
assertTrue(statistics.isPresent());
857857
}
858+
859+
@Test
860+
public void testTriggerHousekeeping() throws GitLabApiException {
861+
assertNotNull(testProject);
862+
gitLabApi.getProjectApi().triggerHousekeeping(testProject);
863+
}
858864
}

0 commit comments

Comments
 (0)