use of io.gravitee.rest.api.model.log.SearchLogResponse in project gravitee-management-rest-api by gravitee-io.
the class ApplicationLogsResourceTest method shouldGetNoLogAndNoLink.
@Test
public void shouldGetNoLogAndNoLink() {
SearchLogResponse<ApplicationRequestItem> emptySearchResponse = new SearchLogResponse<>(0);
emptySearchResponse.setLogs(Collections.emptyList());
doReturn(emptySearchResponse).when(logsService).findByApplication(eq(APPLICATION), any());
final Response response = target(APPLICATION).path("logs").queryParam("page", 1).queryParam("size", 10).queryParam("query", APPLICATION).queryParam("from", 0).queryParam("to", 100).queryParam("field", APPLICATION).queryParam("order", "ASC").request().get();
assertEquals(HttpStatusCode.OK_200, response.getStatus());
LogsResponse logsResponse = response.readEntity(LogsResponse.class);
assertEquals(0, logsResponse.getData().size());
Links links = logsResponse.getLinks();
assertNull(links);
}
Aggregations