11package com .sap .ai .sdk .app .controllers ;
22
3+ import static com .sap .ai .sdk .orchestration .model .ResponseChatMessage .RoleEnum .ASSISTANT ;
34import static org .assertj .core .api .Assertions .assertThat ;
45import static org .assertj .core .api .Assertions .assertThatThrownBy ;
56
@@ -86,7 +87,7 @@ void testTemplate() {
8687 var choices = llm .getChoices ();
8788 assertThat (choices .get (0 ).getIndex ()).isZero ();
8889 assertThat (choices .get (0 ).getMessage ().getContent ()).isNotEmpty ();
89- assertThat (choices .get (0 ).getMessage ().getRole ()).isEqualTo ("assistant" );
90+ assertThat (choices .get (0 ).getMessage ().getRole ()).isEqualTo (ASSISTANT );
9091 assertThat (choices .get (0 ).getFinishReason ()).isEqualTo ("stop" );
9192 var usage = result .getTokenUsage ();
9293 assertThat (usage .getCompletionTokens ()).isGreaterThan (1 );
@@ -100,7 +101,7 @@ void testTemplate() {
100101 choices = orchestrationResult .getChoices ();
101102 assertThat (choices .get (0 ).getIndex ()).isZero ();
102103 assertThat (choices .get (0 ).getMessage ().getContent ()).isNotEmpty ();
103- assertThat (choices .get (0 ).getMessage ().getRole ()).isEqualTo ("assistant" );
104+ assertThat (choices .get (0 ).getMessage ().getRole ()).isEqualTo (ASSISTANT );
104105 assertThat (choices .get (0 ).getFinishReason ()).isEqualTo ("stop" );
105106 assertThat (result .getChoice ()).isSameAs (choices .get (0 ));
106107 usage = result .getTokenUsage ();
@@ -201,7 +202,7 @@ void testInputFilteringStrict() {
201202 assertThatThrownBy (() -> service .inputFiltering (policy ))
202203 .isInstanceOf (OrchestrationClientException .class )
203204 .hasMessageContaining (
204- "Content filtered due to safety violations. Please modify the prompt and try again." )
205+ "Prompt filtered due to safety violations. Please modify the prompt and try again." )
205206 .hasMessageContaining ("400 Bad Request" );
206207 }
207208
@@ -246,7 +247,7 @@ void testLlamaGuardEnabled() {
246247 assertThatThrownBy (() -> service .llamaGuardInputFilter (true ))
247248 .isInstanceOf (OrchestrationClientException .class )
248249 .hasMessageContaining (
249- "Content filtered due to safety violations. Please modify the prompt and try again." )
250+ "Prompt filtered due to safety violations. Please modify the prompt and try again." )
250251 .hasMessageContaining ("400 Bad Request" );
251252 }
252253
0 commit comments