Search in sources :

Example 6 with JsonDocument

use of io.lumeer.api.dto.JsonDocument in project engine by Lumeer.

the class DocumentServiceIT method testGetAllDocuments.

@Test
@Ignore("Works manually but there is unexpected exception in tests")
public void testGetAllDocuments() {
    String id1 = createDocument().getId();
    String id2 = createDocument().getId();
    Response response = client.target(DOCUMENTS_URL_PREFIX).path(collection.getId()).path("documents").request(MediaType.APPLICATION_JSON).buildGet().invoke();
    assertThat(response).isNotNull();
    assertThat(response.getStatusInfo()).isEqualTo(Response.Status.OK);
    List<JsonDocument> documents = response.readEntity(new GenericType<List<JsonDocument>>() {
    });
    assertThat(documents).extracting(Document::getId).containsOnly(id1, id2);
}
Also used : Response(javax.ws.rs.core.Response) List(java.util.List) JsonDocument(io.lumeer.api.dto.JsonDocument) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

JsonDocument (io.lumeer.api.dto.JsonDocument)6 DataDocument (io.lumeer.engine.api.data.DataDocument)5 Document (io.lumeer.api.model.Document)3 Response (javax.ws.rs.core.Response)2 Ignore (org.junit.Ignore)2 Test (org.junit.Test)2 Pagination (io.lumeer.api.model.Pagination)1 URI (java.net.URI)1 List (java.util.List)1 GET (javax.ws.rs.GET)1 POST (javax.ws.rs.POST)1 SoftAssertions (org.assertj.core.api.SoftAssertions)1