11package com .sap .ai .sdk .orchestration ;
22
33import static com .sap .ai .sdk .orchestration .AzureContentFilter .Sensitivity .HIGH ;
4+ import static com .sap .ai .sdk .orchestration .AzureContentFilter .Sensitivity .LOW ;
45import static com .sap .ai .sdk .orchestration .ModuleConfigFactory .toModuleConfigDTO ;
56import static com .sap .ai .sdk .orchestration .client .model .FilterConfig .TypeEnum .AZURE_CONTENT_SAFETY ;
67import static org .assertj .core .api .Assertions .assertThat ;
@@ -138,8 +139,8 @@ void testOutputFilter() {
138139
139140 @ Test
140141 void testInputAndOutputFilter () {
141- var inputFilter = new AzureContentFilter ();
142- var outputFilter = new AzureContentFilter ();
142+ var inputFilter = new AzureContentFilter (). hate ( HIGH ) ;
143+ var outputFilter = new AzureContentFilter (). violence ( LOW ) ;
143144 config .withInputContentFilter (inputFilter );
144145 config .withOutputContentFilter (outputFilter );
145146
@@ -149,6 +150,15 @@ void testInputAndOutputFilter() {
149150 assertThat (result .getOutput ().getFilters ()).isNotEmpty ();
150151 }
151152
153+ @ Test
154+ void testEmptyFilter () {
155+ var inputFilter = new AzureContentFilter ();
156+ assertThatThrownBy (inputFilter ::toFilterConfigDTO )
157+ .isInstanceOf (IllegalStateException .class )
158+ .hasMessageContaining (
159+ "When configuring an azure content filter, at least one filter category must be set" );
160+ }
161+
152162 @ Test
153163 void testMasking () {
154164 var maskingConfig = DpiMaskingConfig .anonymization ().withEntities (DPIEntities .ADDRESS );
0 commit comments