Skip to content

Commit a9732fc

Browse files
authored
Fix e2e test for new messages (#476)
Co-authored-by: Jonas Israel <[email protected]>
1 parent 5ad496f commit a9732fc

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ public OrchestrationChatResponse messagesHistory(@Nonnull final String prevMessa
163163
public OrchestrationChatResponse inputFiltering(@Nonnull final AzureFilterThreshold policy)
164164
throws OrchestrationClientException {
165165
val prompt =
166-
new OrchestrationPrompt("'We shall spill blood tonight', said the operation in-charge.");
166+
new OrchestrationPrompt(
167+
"Please rephrase the following sentence for me: 'We shall spill blood tonight', said the operator in-charge.");
167168
val filterConfig =
168169
new AzureContentFilter().hate(policy).selfHarm(policy).sexual(policy).violence(policy);
169170

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void testInputFilteringLenient() {
241241
assertThat(response.getContent()).isNotEmpty();
242242

243243
var filterResult = response.getOriginalResponse().getModuleResults().getInputFiltering();
244-
assertThat(filterResult.getMessage()).contains("passed");
244+
assertThat(filterResult.getMessage()).contains("skipped");
245245
}
246246

247247
@Test
@@ -284,7 +284,7 @@ void testLlamaGuardDisabled() {
284284
assertThat(response.getContent()).isNotEmpty();
285285

286286
var filterResult = response.getOriginalResponse().getModuleResults().getInputFiltering();
287-
assertThat(filterResult.getMessage()).contains("passed");
287+
assertThat(filterResult.getMessage()).contains("skipped");
288288
}
289289

290290
@Test
@@ -415,7 +415,7 @@ void testStreamingErrorHandlingMasking() {
415415
assertThatThrownBy(() -> client.streamChatCompletion(prompt, configWithMasking))
416416
.isInstanceOf(OrchestrationClientException.class)
417417
.hasMessageContaining("status 400 Bad Request")
418-
.hasMessageContaining("'type': 'sap_data_privacy_integration', 'method': 'anonymization'");
418+
.hasMessageContaining("'unknown_default_open_api' is not one of");
419419
}
420420

421421
@Test

sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/SpringAiOrchestrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void testInputFilteringLenient() {
8686
.getOriginalResponse()
8787
.getModuleResults()
8888
.getInputFiltering();
89-
assertThat(filterResult.getMessage()).contains("passed");
89+
assertThat(filterResult.getMessage()).contains("skipped");
9090
}
9191

9292
@Test

0 commit comments

Comments
 (0)