Search in sources :

Example 1 with LogEvent

use of com.auth0.json.mgmt.logevents.LogEvent in project auth0-java by auth0.

the class LogEventsEntityTest method shouldGetLogEvent.

@Test
public void shouldGetLogEvent() throws Exception {
    Request<LogEvent> request = api.logEvents().get("1");
    assertThat(request, is(notNullValue()));
    server.jsonResponse(MGMT_LOG_EVENT, 200);
    LogEvent response = request.execute();
    RecordedRequest recordedRequest = server.takeRequest();
    assertThat(recordedRequest, hasMethodAndPath("GET", "/api/v2/logs/1"));
    assertThat(recordedRequest, hasHeader("Content-Type", "application/json"));
    assertThat(recordedRequest, hasHeader("Authorization", "Bearer apiToken"));
    assertThat(response, is(notNullValue()));
}
Also used : RecordedRequest(okhttp3.mockwebserver.RecordedRequest) LogEvent(com.auth0.json.mgmt.logevents.LogEvent) Test(org.junit.Test)

Aggregations

LogEvent (com.auth0.json.mgmt.logevents.LogEvent)1 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)1 Test (org.junit.Test)1