use of com.auth0.json.mgmt.logstreams.LogStream in project auth0-java by auth0.
the class LogStreamsEntityTest method shouldListLogStreams.
@Test
public void shouldListLogStreams() throws Exception {
Request<List<LogStream>> request = api.logStreams().list();
assertThat(request, is(notNullValue()));
server.jsonResponse(MockServer.MGMT_LOG_STREAMS_LIST, 200);
List<LogStream> response = request.execute();
RecordedRequest recordedRequest = server.takeRequest();
assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/log-streams"));
assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
assertThat(response, is(notNullValue()));
assertThat(response, hasSize(2));
assertThat(response, everyItem(hasProperty("id", is(notNullValue()))));
assertThat(response, everyItem(hasProperty("name", is(notNullValue()))));
assertThat(response, everyItem(hasProperty("type", is(notNullValue()))));
assertThat(response, everyItem(hasProperty("status", is(notNullValue()))));
assertThat(response, everyItem(hasProperty("sink", is(notNullValue()))));
}
Aggregations