Search in sources :

Example 51 with Response

use of jakarta.ws.rs.core.Response in project OpenGrok by OpenGrok.

the class ProjectsControllerTest method testSetIndexed.

@Test
void testSetIndexed() {
    String project = "git";
    addProject(project);
    assertEquals(1, env.getProjectList().size());
    env.getProjects().get(project).setIndexed(false);
    assertFalse(env.getProjects().get(project).isIndexed());
    Response response = target("projects").path(project).path("property/indexed").request().put(Entity.text(Boolean.TRUE.toString()));
    assertEquals(response.getStatus(), Response.Status.NO_CONTENT.getStatusCode());
    assertTrue(env.getProjects().get(project).isIndexed());
}
Also used : Response(jakarta.ws.rs.core.Response) MercurialRepositoryTest(org.opengrok.indexer.history.MercurialRepositoryTest) Test(org.junit.jupiter.api.Test)

Aggregations

Response (jakarta.ws.rs.core.Response)51 Test (org.junit.jupiter.api.Test)43 ContainerRequestContext (jakarta.ws.rs.container.ContainerRequestContext)6 Path (java.nio.file.Path)3 TreeMap (java.util.TreeMap)3 Configuration (org.opengrok.indexer.configuration.Configuration)3 RuntimeEnvironment (org.opengrok.indexer.configuration.RuntimeEnvironment)3 Message (org.opengrok.indexer.web.messages.Message)3 AcceptedMessage (org.opengrok.indexer.web.messages.MessagesContainer.AcceptedMessage)3 ApiTask (org.opengrok.web.api.ApiTask)3 ApiTaskManager (org.opengrok.web.api.ApiTaskManager)3 File (java.io.File)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 HttpServletRequest (jakarta.servlet.http.HttpServletRequest)1 HttpServletResponse (jakarta.servlet.http.HttpServletResponse)1 NotFoundException (jakarta.ws.rs.NotFoundException)1 WebApplicationException (jakarta.ws.rs.WebApplicationException)1 Client (jakarta.ws.rs.client.Client)1 Invocation (jakarta.ws.rs.client.Invocation)1 IOException (java.io.IOException)1