@@ -73,37 +73,6 @@ class OrchestrationUnitTest {
7373 private OrchestrationModuleConfig config ;
7474 private OrchestrationPrompt prompt ;
7575
76- private static FilteringModuleConfig createAzureContentFilter (
77- @ Nonnull final AzureThreshold threshold ) {
78- final var filter =
79- new AzureContentSafetyFilterConfig ()
80- .type (AzureContentSafetyFilterConfig .TypeEnum .AZURE_CONTENT_SAFETY )
81- .config (
82- new AzureContentSafety ()
83- .hate (threshold )
84- .selfHarm (threshold )
85- .sexual (threshold )
86- .violence (threshold ));
87-
88- return new FilteringModuleConfig ()
89- .input (new InputFilteringConfig ().filters (List .of (filter )))
90- .output (new OutputFilteringConfig ().filters (List .of (filter )));
91- }
92-
93- private static MaskingModuleConfig createMaskingConfig (
94- @ Nonnull final DPIConfig .MethodEnum method , @ Nonnull final DPIEntities ... entities ) {
95-
96- final var entityConfigs =
97- Arrays .stream (entities ).map (it -> new DPIEntityConfig ().type (it )).toList ();
98- return new MaskingModuleConfig ()
99- .maskingProviders (
100- List .of (
101- new DPIConfig ()
102- .type (DPIConfig .TypeEnum .SAP_DATA_PRIVACY_INTEGRATION )
103- .method (method )
104- .entities (entityConfigs )));
105- }
106-
10776 @ BeforeEach
10877 void setup (WireMockRuntimeInfo server ) {
10978 stubFor (
@@ -276,6 +245,23 @@ void filteringStrict() {
276245 "Request to orchestration service failed with status 400 Bad Request and error message: 'Content filtered due to Safety violations. Please modify the prompt and try again.'" );
277246 }
278247
248+ private static FilteringModuleConfig createAzureContentFilter (
249+ @ Nonnull final AzureThreshold threshold ) {
250+ final var filter =
251+ new AzureContentSafetyFilterConfig ()
252+ .type (AzureContentSafetyFilterConfig .TypeEnum .AZURE_CONTENT_SAFETY )
253+ .config (
254+ new AzureContentSafety ()
255+ .hate (threshold )
256+ .selfHarm (threshold )
257+ .sexual (threshold )
258+ .violence (threshold ));
259+
260+ return new FilteringModuleConfig ()
261+ .input (new InputFilteringConfig ().filters (List .of (filter )))
262+ .output (new OutputFilteringConfig ().filters (List .of (filter )));
263+ }
264+
279265 @ Test
280266 void messagesHistory () throws IOException {
281267 stubFor (
@@ -338,6 +324,20 @@ void maskingAnonymization() throws IOException {
338324 }
339325 }
340326
327+ private static MaskingModuleConfig createMaskingConfig (
328+ @ Nonnull final DPIConfig .MethodEnum method , @ Nonnull final DPIEntities ... entities ) {
329+
330+ final var entityConfigs =
331+ Arrays .stream (entities ).map (it -> new DPIEntityConfig ().type (it )).toList ();
332+ return new MaskingModuleConfig ()
333+ .maskingProviders (
334+ List .of (
335+ new DPIConfig ()
336+ .type (DPIConfig .TypeEnum .SAP_DATA_PRIVACY_INTEGRATION )
337+ .method (method )
338+ .entities (entityConfigs )));
339+ }
340+
341341 @ Test
342342 void testGenericErrorHandling () {
343343 stubFor (post (anyUrl ()).willReturn (serverError ()));
0 commit comments