Skip to content

Commit a1b7749

Browse files
authored
Fix E2E Test (#194)
1 parent d5fa33d commit a1b7749

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
import com.sap.ai.sdk.orchestration.client.model.CompletionPostResponse;
99
import com.sap.ai.sdk.orchestration.client.model.LLMChoice;
1010
import com.sap.ai.sdk.orchestration.client.model.LLMModuleResultSynchronous;
11-
import java.util.List;
1211
import java.util.Map;
1312
import lombok.extern.slf4j.Slf4j;
14-
import org.assertj.core.api.InstanceOfAssertFactories;
1513
import org.junit.jupiter.api.BeforeEach;
1614
import org.junit.jupiter.api.Test;
1715

@@ -114,9 +112,9 @@ void testMaskingAnonymization() {
114112
var maskingResult = result.getModuleResults().getInputMasking();
115113
assertThat(maskingResult.getMessage()).isNotEmpty();
116114
var data = (Map<String, Object>) maskingResult.getData();
117-
var maskedMessage = ((List<Map<String, Object>>) data.get("masked_template")).get(0);
118-
assertThat(maskedMessage.get("content"))
119-
.asInstanceOf(InstanceOfAssertFactories.STRING)
115+
var maskedMessage = (String) data.get("masked_template");
116+
assertThat(maskedMessage)
117+
.describedAs("The masked input should not contain any user names")
120118
.doesNotContain("Alice", "Bob");
121119

122120
assertThat(result.getModuleResults().getOutputUnmasking()).isEmpty();

0 commit comments

Comments
 (0)