Search in sources :

Example 1 with ChunkedInput

use of org.glassfish.jersey.client.ChunkedInput in project Gaffer by gchq.

the class OperationServiceIT method shouldReturnChunkedGroupCounts.

@Test
public void shouldReturnChunkedGroupCounts() throws IOException {
    // Given
    RestApiTestUtil.addElements(DEFAULT_ELEMENTS);
    // When
    final Response response = RestApiTestUtil.executeOperationChainChunked(new OperationChain.Builder().first(new GetAllElements<>()).then(new CountGroups()).build());
    // Then
    final List<GroupCounts> results = readChunkedResults(response, new GenericType<ChunkedInput<GroupCounts>>() {
    });
    assertEquals(1, results.size());
    final GroupCounts groupCounts = results.get(0);
    verifyGroupCounts(groupCounts);
}
Also used : Response(javax.ws.rs.core.Response) ChunkedInput(org.glassfish.jersey.client.ChunkedInput) CountGroups(uk.gov.gchq.gaffer.operation.impl.CountGroups) GetAllElements(uk.gov.gchq.gaffer.operation.impl.get.GetAllElements) GroupCounts(uk.gov.gchq.gaffer.data.GroupCounts) Test(org.junit.Test)

Aggregations

Response (javax.ws.rs.core.Response)1 ChunkedInput (org.glassfish.jersey.client.ChunkedInput)1 Test (org.junit.Test)1 GroupCounts (uk.gov.gchq.gaffer.data.GroupCounts)1 CountGroups (uk.gov.gchq.gaffer.operation.impl.CountGroups)1 GetAllElements (uk.gov.gchq.gaffer.operation.impl.get.GetAllElements)1