Skip to content

Commit 1cb2d47

Browse files
committed
fix tests
1 parent 1d6a684 commit 1cb2d47

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/ProjectsControllerTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ void testIndexed() throws IOException {
393393
// Test that the project's indexed flag becomes true only after
394394
// the message is applied.
395395

396-
markIndexed(projectName);
397396

397+
assertEquals(markIndexed(projectName).getStatusInfo().getFamily(), Response.Status.Family.SUCCESSFUL);
398398
assertTrue(env.getProjects().get(projectName).isIndexed(), "indexed flag should be set to true");
399399

400400
// Test that the "indexed" message triggers refresh of current version
@@ -406,18 +406,19 @@ void testIndexed() throws IOException {
406406
assertTrue(ri.getCurrentVersion().contains("c78fa757c524"), "current version should be refreshed");
407407
}
408408

409-
private void markIndexed(final String project) {
410-
target("projects")
409+
private Response markIndexed(final String project) {
410+
Response response = target("projects")
411411
.path(project)
412412
.path("indexed")
413413
.request()
414414
.put(Entity.text(""));
415+
return waitForTask(response);
415416
}
416417

417418
@Test
418419
void testList() {
419420
addProject("mercurial");
420-
markIndexed("mercurial");
421+
assertEquals(markIndexed("mercurial").getStatusInfo().getFamily(), Response.Status.Family.SUCCESSFUL);
421422

422423
// Add another project.
423424
addProject("git");

0 commit comments

Comments
 (0)