@@ -44,7 +44,8 @@ class HttpClientHelperTests {
4444 void executeMapsRequestAndResponse () {
4545 RecordingHttpClient recordingClient = new RecordingHttpClient (request -> createMockResponse (request , 201 ,
4646 new HttpHeaders ().set (REQUEST_ID_HEADER , "req-123" ).set (CUSTOM_HEADER_NAME , "custom-value" ), "pong" ));
47- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
47+ com .openai .core .http .HttpClient openAiClient
48+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
4849
4950 com .openai .core .http .HttpRequest openAiRequest = createOpenAiRequest ();
5051
@@ -71,7 +72,8 @@ void executeMapsRequestAndResponse() {
7172 void executeAsyncCompletesSuccessfully () {
7273 RecordingHttpClient recordingClient
7374 = new RecordingHttpClient (request -> createMockResponse (request , 204 , new HttpHeaders (), "" ));
74- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
75+ com .openai .core .http .HttpClient openAiClient
76+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
7577
7678 com .openai .core .http .HttpRequest openAiRequest = createOpenAiRequest ();
7779
@@ -94,7 +96,8 @@ void executeWithNullRequestBodySucceeds() throws Exception {
9496 }
9597 return createMockResponse (request , 200 , new HttpHeaders (), "success" );
9698 });
97- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
99+ com .openai .core .http .HttpClient openAiClient
100+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
98101
99102 com .openai .core .http .HttpRequest openAiRequest = com .openai .core .http .HttpRequest .builder ()
100103 .method (com .openai .core .http .HttpMethod .GET )
@@ -112,7 +115,8 @@ void executeWithNullRequestBodySucceeds() throws Exception {
112115 void executeThrowsUncheckedIOExceptionOnBodyBufferingFailure () {
113116 RecordingHttpClient recordingClient
114117 = new RecordingHttpClient (request -> createMockResponse (request , 200 , new HttpHeaders (), "" ));
115- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
118+ com .openai .core .http .HttpClient openAiClient
119+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
116120
117121 com .openai .core .http .HttpRequest openAiRequest = com .openai .core .http .HttpRequest .builder ()
118122 .method (com .openai .core .http .HttpMethod .POST )
@@ -133,7 +137,8 @@ void executeThrowsUncheckedIOExceptionOnBodyBufferingFailure() {
133137 void executeThrowsExceptionOnMalformedUrl () {
134138 RecordingHttpClient recordingClient
135139 = new RecordingHttpClient (request -> createMockResponse (request , 200 , new HttpHeaders (), "" ));
136- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
140+ com .openai .core .http .HttpClient openAiClient
141+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
137142
138143 com .openai .core .http .HttpRequest openAiRequest = com .openai .core .http .HttpRequest .builder ()
139144 .method (com .openai .core .http .HttpMethod .GET )
@@ -150,7 +155,8 @@ void executeThrowsExceptionOnMalformedUrl() {
150155 void executeAsyncPropagatesRequestBuildingErrors () {
151156 RecordingHttpClient recordingClient
152157 = new RecordingHttpClient (request -> createMockResponse (request , 200 , new HttpHeaders (), "" ));
153- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
158+ com .openai .core .http .HttpClient openAiClient
159+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (recordingClient ).build ());
154160
155161 com .openai .core .http .HttpRequest openAiRequest = com .openai .core .http .HttpRequest .builder ()
156162 .method (com .openai .core .http .HttpMethod .POST )
@@ -170,7 +176,8 @@ void executeAsyncPropagatesRequestBuildingErrors() {
170176 @ Test
171177 void executeAsyncPropagatesHttpClientFailures () {
172178 FailingHttpClient failingClient = new FailingHttpClient (new RuntimeException ("Network error" ));
173- com .openai .core .http .HttpClient openAiClient = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (failingClient ).build ());
179+ com .openai .core .http .HttpClient openAiClient
180+ = HttpClientHelper .mapToOpenAIHttpClient (new HttpPipelineBuilder ().httpClient (failingClient ).build ());
174181
175182 com .openai .core .http .HttpRequest openAiRequest = com .openai .core .http .HttpRequest .builder ()
176183 .method (com .openai .core .http .HttpMethod .GET )
0 commit comments