File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
orchestration/src/test/java/com/sap/ai/sdk/orchestration Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 77import com .sap .ai .sdk .orchestration .client .model .ChatMessage ;
88import com .sap .ai .sdk .orchestration .client .model .TemplatingModuleConfig ;
99import java .util .List ;
10+ import java .util .Map ;
1011import org .junit .jupiter .api .Test ;
1112
1213class ConfigToRequestTransformerTest {
1314
1415 @ Test
1516 void testThrowsOnMissingLlmConfig () {
16- assertThatThrownBy (
17- ( ) -> ConfigToRequestTransformer .toModuleConfigs (new OrchestrationModuleConfig () ))
17+ var config = new OrchestrationModuleConfig ();
18+ assertThatThrownBy (( ) -> ConfigToRequestTransformer .toModuleConfigs (config ))
1819 .isInstanceOf (IllegalStateException .class )
1920 .hasMessageContaining ("LLM config is required" );
2021 }
2122
23+ @ Test
24+ void testThrowsOnMissingMessages () {
25+ var prompt = new OrchestrationPrompt (Map .of ());
26+
27+ assertThatThrownBy (() -> ConfigToRequestTransformer .toTemplateModuleConfig (prompt , null ))
28+ .isInstanceOf (IllegalStateException .class )
29+ .hasMessageContaining ("A prompt is required" );
30+ }
31+
2232 @ Test
2333 void testEmptyTemplateConfig () {
2434 var systemMessage = ChatMessage .create ().role ("system" ).content ("foo" );
Original file line number Diff line number Diff line change 7373 <enforcer .skipBanGeneratedModulesReference>false</enforcer .skipBanGeneratedModulesReference>
7474 <!-- Test coverage -->
7575 <coverage .instruction>74%</coverage .instruction>
76- <coverage .branch>60 %</coverage .branch>
76+ <coverage .branch>62 %</coverage .branch>
7777 <coverage .complexity>67%</coverage .complexity>
7878 <coverage .line>75%</coverage .line>
7979 <coverage .method>80%</coverage .method>
You can’t perform that action at this time.
0 commit comments