Skip to content

Commit 9b91318

Browse files
ahornaceVladimir Kotal
authored andcommitted
Fix failing wildcard test
1 parent d084bc7 commit 9b91318

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/org/opensolaris/opengrok/web/api/v1/controller/SuggesterController.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,18 @@ public void addSearchCountsRaw(@Valid final List<TermIncrementData> termIncremen
252252
}
253253
}
254254

255+
/**
256+
* Returns the searched terms sorted according to their popularity.
257+
* @param project project for which to return the data
258+
* @param field field for which to return the data
259+
* @param page which page of data to retrieve
260+
* @param pageSize number of results to return
261+
* @return list of terms with their popularity
262+
*/
255263
@GET
256264
@Path("/popularity/{project}")
257265
@Produces(MediaType.APPLICATION_JSON)
258-
public List<Entry<String, Integer>> getPopularityData(
266+
public List<Entry<String, Integer>> getPopularityDataPaged(
259267
@PathParam("project") final String project,
260268
@QueryParam("field") @DefaultValue(QueryBuilder.FULL) final String field,
261269
@QueryParam("page") @DefaultValue("" + 0) final int page,

test/org/opensolaris/opengrok/web/api/v1/controller/SuggesterControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ public void testWildcardQueryEndingWithAsterisk() {
612612
.get(Result.class);
613613

614614
assertThat(res.suggestions.stream().map(r -> r.phrase).collect(Collectors.toList()),
615-
contains("printf"));
615+
containsInAnyOrder("print", "printf"));
616616
}
617617

618618
}

0 commit comments

Comments
 (0)