use of org.sonar.server.component.ws.SuggestionsAction.SHORT_INPUT_WARNING in project sonarqube by SonarSource.
the class SuggestionsActionTest method must_not_search_if_no_valid_tokens_are_provided.
@Test
public void must_not_search_if_no_valid_tokens_are_provided() {
ComponentDto project = db.components().insertComponent(newPrivateProjectDto().setName("SonarQube"));
componentIndexer.indexAll();
authorizationIndexerTester.allowOnlyAnyone(project);
SuggestionsWsResponse response = ws.newRequest().setMethod("POST").setParam(PARAM_QUERY, "S o").executeProtobuf(SuggestionsWsResponse.class);
assertThat(response.getResultsList()).filteredOn(q -> q.getItemsCount() > 0).isEmpty();
assertThat(response.getWarning()).contains(SHORT_INPUT_WARNING);
}
Aggregations