use of com.microsoft.rest.RestClient in project autorest.java by Azure.
the class LROsTests method setup.
@BeforeClass
public static void setup() {
RestClient restClient = new RestClient.Builder().withBaseUrl("http://localhost:3000").withSerializerAdapter(new AzureJacksonAdapter()).withResponseBuilderFactory(new AzureResponseBuilder.Factory()).build();
client = new AutoRestLongRunningOperationTestServiceImpl(restClient);
client.getAzureClient().setLongRunningOperationRetryTimeout(0);
}
use of com.microsoft.rest.RestClient in project azure-tools-for-java by Microsoft.
the class IntegrationTestBase method createRestClient.
private RestClient createRestClient(ApplicationTokenCredentials credentials) throws Exception {
RestClient restClient;
if (IS_MOCKED) {
credentials = new TestCredentials();
restClient = new RestClient.Builder().withBaseUrl(MOCK_URI + "/").withSerializerAdapter(new AzureJacksonAdapter()).withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials).withLogLevel(LogLevel.BODY_AND_HEADERS).withInterceptor(interceptor).build();
return restClient;
} else {
restClient = new RestClient.Builder().withBaseUrl(GLOBAL_ENDPOINT).withSerializerAdapter(new AzureJacksonAdapter()).withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(credentials).withLogLevel(LogLevel.BODY_AND_HEADERS).withInterceptor(interceptor).build();
return restClient;
}
}
use of com.microsoft.rest.RestClient in project azure-tools-for-java by Microsoft.
the class IntegrationTestBase method createRestClient.
private RestClient createRestClient(ApplicationTokenCredentials credentials) {
final RestClient client;
ApplicationTokenCredentials cred = credentials;
if (IS_MOCKED) {
cred = new TestCredentials();
client = new RestClient.Builder().withBaseUrl(MOCK_URI + "/").withSerializerAdapter(new AzureJacksonAdapter()).withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(cred).withLogLevel(LogLevel.BODY_AND_HEADERS).withInterceptor(interceptor).build();
} else {
client = new RestClient.Builder().withBaseUrl(GLOBAL_ENDPOINT).withSerializerAdapter(new AzureJacksonAdapter()).withResponseBuilderFactory(new AzureResponseBuilder.Factory()).withCredentials(cred).withLogLevel(LogLevel.BODY_AND_HEADERS).withInterceptor(interceptor).build();
}
return client;
}
Aggregations