|
16 | 16 | import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; |
17 | 17 | import com.github.tomakehurst.wiremock.junit5.WireMockTest; |
18 | 18 | import com.sap.ai.sdk.orchestration.OrchestrationClient; |
19 | | -import com.sap.ai.sdk.orchestration.OrchestrationClientException; |
20 | 19 | import com.sap.ai.sdk.orchestration.OrchestrationModuleConfig; |
21 | 20 | import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; |
22 | 21 | import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; |
@@ -102,31 +101,6 @@ void testThrowsOnMissingLlmConfig() { |
102 | 101 | .hasMessageContaining("LLM config is required"); |
103 | 102 | } |
104 | 103 |
|
105 | | - @Test |
106 | | - void streamChatCompletionOutputFilterErrorHandling() throws IOException { |
107 | | - try (var inputStream = spy(fileLoader.apply("streamChatCompletionOutputFilter.txt"))) { |
108 | | - |
109 | | - final var httpClient = mock(HttpClient.class); |
110 | | - ApacheHttpClient5Accessor.setHttpClientFactory(destination -> httpClient); |
111 | | - |
112 | | - // Create a mock response |
113 | | - final var mockResponse = new BasicClassicHttpResponse(200, "OK"); |
114 | | - final var inputStreamEntity = new InputStreamEntity(inputStream, ContentType.TEXT_PLAIN); |
115 | | - mockResponse.setEntity(inputStreamEntity); |
116 | | - mockResponse.setHeader("Content-Type", "text/event-stream"); |
117 | | - |
118 | | - // Configure the HttpClient mock to return the mock response |
119 | | - doReturn(mockResponse).when(httpClient).executeOpen(any(), any(), any()); |
120 | | - |
121 | | - Flux<ChatResponse> flux = client.stream(prompt); |
122 | | - assertThatThrownBy(() -> flux.toStream().forEach(System.out::println)) |
123 | | - .isInstanceOf(OrchestrationClientException.class) |
124 | | - .hasMessage("Content filter filtered the output."); |
125 | | - |
126 | | - Mockito.verify(inputStream, times(1)).close(); |
127 | | - } |
128 | | - } |
129 | | - |
130 | 104 | @Test |
131 | 105 | void testStreamCompletion() throws IOException { |
132 | 106 | try (var inputStream = spy(fileLoader.apply("streamChatCompletion.txt"))) { |
|
0 commit comments