use of jakarta.ws.rs.core.Response in project OpenGrok by OpenGrok.
the class SuggesterControllerTest method zTestRebuildProject.
@Test
void zTestRebuildProject() throws InterruptedException {
Response res = target(SuggesterController.PATH).path("rebuild").path("c").request().put(Entity.text(""));
assertEquals(Response.Status.NO_CONTENT.getStatusCode(), res.getStatus());
SuggesterServiceImpl.getInstance().waitForRebuild(15, TimeUnit.SECONDS);
}
use of jakarta.ws.rs.core.Response in project OpenGrok by OpenGrok.
the class SuggesterControllerTest method testDisabledSuggestions.
@Test
void testDisabledSuggestions() {
env.getSuggesterConfig().setEnabled(false);
Response r = target(SuggesterController.PATH).queryParam(AuthorizationFilter.PROJECTS_PARAM, "java").queryParam("field", QueryBuilder.FULL).queryParam(QueryBuilder.FULL, "inner").request().get();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), r.getStatus());
}
use of jakarta.ws.rs.core.Response in project OpenGrok by OpenGrok.
the class SuggesterControllerTest method testGetSuggesterConfigCors.
@Test
void testGetSuggesterConfigCors() {
Response response = target(SuggesterController.PATH).path("config").request().header(CORS_REQUEST_HEADER, "http://example.com").get();
assertEquals("*", response.getHeaderString(ALLOW_CORS_HEADER));
}
use of jakarta.ws.rs.core.Response in project OpenGrok by OpenGrok.
the class SuggesterControllerTest method testMaxProjects.
@Test
void testMaxProjects() {
env.getSuggesterConfig().setMaxProjects(1);
Response r = target(SuggesterController.PATH).queryParam(AuthorizationFilter.PROJECTS_PARAM, "java", "kotlin").queryParam("field", QueryBuilder.FULL).queryParam(QueryBuilder.FULL, "me").request().get();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), r.getStatus());
}
use of jakarta.ws.rs.core.Response in project OpenGrok by OpenGrok.
the class SuggesterControllerTest method testMinChars.
@Test
void testMinChars() {
env.getSuggesterConfig().setMinChars(2);
Response r = target(SuggesterController.PATH).queryParam(AuthorizationFilter.PROJECTS_PARAM, "java").queryParam("field", QueryBuilder.FULL).queryParam(QueryBuilder.FULL, "i").request().get();
assertEquals(Response.Status.NOT_FOUND.getStatusCode(), r.getStatus());
}
Aggregations