Search in sources :

Example 6 with Telemetry

use of com.auth0.net.Telemetry in project auth0-java-mvc-common by auth0.

the class AuthenticationControllerTest method shouldSetupClientWithTelemetry.

@Test
public void shouldSetupClientWithTelemetry() {
    AuthenticationController controller = builderSpy.build();
    ArgumentCaptor<Telemetry> telemetryCaptor = ArgumentCaptor.forClass(Telemetry.class);
    assertThat(controller, is(notNullValue()));
    RequestProcessor requestProcessor = controller.getRequestProcessor();
    assertThat(requestProcessor.getClient(), is(client));
    verify(client).setTelemetry(telemetryCaptor.capture());
    Telemetry capturedTelemetry = telemetryCaptor.getValue();
    assertThat(capturedTelemetry, is(notNullValue()));
    assertThat(capturedTelemetry.getName(), is("auth0-java-mvc-common"));
    assertThat(capturedTelemetry.getVersion(), is("1.2.3"));
}
Also used : Telemetry(com.auth0.net.Telemetry) Test(org.junit.jupiter.api.Test)

Aggregations

RateLimitInterceptor (com.auth0.net.RateLimitInterceptor)4 TelemetryInterceptor (com.auth0.net.TelemetryInterceptor)3 HttpLoggingInterceptor (okhttp3.logging.HttpLoggingInterceptor)3 Test (org.junit.Test)3 ProxyOptions (com.auth0.client.ProxyOptions)2 Telemetry (com.auth0.net.Telemetry)2 IOException (java.io.IOException)2 PasswordlessEmailResponse (com.auth0.json.auth.PasswordlessEmailResponse)1 PasswordlessSmsResponse (com.auth0.json.auth.PasswordlessSmsResponse)1 Request (com.auth0.net.Request)1 Test (org.junit.jupiter.api.Test)1