Search in sources :

Example 1 with ServiceProfilerSettingsClient

use of com.microsoft.applicationinsights.serviceprofilerapi.config.ServiceProfilerSettingsClient in project ApplicationInsights-Java by microsoft.

the class ServiceProfilerSettingsClientTest method badServiceResponseDoesNotProvideReturn.

@Test
void badServiceResponseDoesNotProvideReturn() throws IOException, URISyntaxException {
    ServiceProfilerClientV2 serviceProfilerClient = Mockito.mock(ServiceProfilerClientV2.class);
    Mockito.when(serviceProfilerClient.getSettings(Mockito.any())).thenReturn(Mono.just(""));
    ServiceProfilerSettingsClient settingsClient = new ServiceProfilerSettingsClient(serviceProfilerClient);
    Mono<ProfilerConfiguration> result = settingsClient.pullSettings();
    assertThatThrownBy(result::block).isInstanceOf(Exception.class);
}
Also used : ServiceProfilerClientV2(com.microsoft.applicationinsights.serviceprofilerapi.client.ServiceProfilerClientV2) ProfilerConfiguration(com.microsoft.applicationinsights.profiler.ProfilerConfiguration) ServiceProfilerSettingsClient(com.microsoft.applicationinsights.serviceprofilerapi.config.ServiceProfilerSettingsClient) Test(org.junit.jupiter.api.Test)

Aggregations

ProfilerConfiguration (com.microsoft.applicationinsights.profiler.ProfilerConfiguration)1 ServiceProfilerClientV2 (com.microsoft.applicationinsights.serviceprofilerapi.client.ServiceProfilerClientV2)1 ServiceProfilerSettingsClient (com.microsoft.applicationinsights.serviceprofilerapi.config.ServiceProfilerSettingsClient)1 Test (org.junit.jupiter.api.Test)1