@@ -87,32 +87,34 @@ void testCreateValidator() {
8787 Map <String , String > options = new HashMap <>();
8888 options .put ("maps" , "tccl:valid-classification.map" );
8989 // deprecated option for whitelisting
90- options .put ("whitelistedResourcePathsPatterns" , "/resourceType1/.*,/resourceType2" );
91- options .put ("severitiesPerClassification" , "INTERNAL=DEBUG" );
90+ options .put ("whitelistedResourcePathsPatterns" , "/resourceType1/.*,/resourceType2, \n /resourceType3 " );
91+ options .put ("severitiesPerClassification" , "INTERNAL=DEBUG, \n INTERNAL_DEPRECATED=INFO " );
9292 ValidatorSettings settings = new ValidatorSettingsImpl (false , ValidationMessageSeverity .WARN , options );
9393 MutableContentClassificationMap map = new MutableContentClassificationMapImpl ("Simple" );
9494 map .put ("/test" , ContentClassification .INTERNAL_DEPRECATED , "Deprecated" );
9595 Collection <String > whiteListedResourceTypes = new LinkedList <>();
9696 whiteListedResourceTypes .add ("/resourceType1/.*" );
9797 whiteListedResourceTypes .add ("/resourceType2" );
98+ whiteListedResourceTypes .add ("/resourceType3" );
9899 Map <ContentClassification , ValidationMessageSeverity > severitiesPerClassification = new HashMap <>();
99100 severitiesPerClassification .put (ContentClassification .INTERNAL , ValidationMessageSeverity .DEBUG );
101+ severitiesPerClassification .put (ContentClassification .INTERNAL_DEPRECATED , ValidationMessageSeverity .INFO );
100102 AemClassificationValidator expectedValidator = new AemClassificationValidator (ValidationMessageSeverity .WARN , new CompositeContentClassificationMap (map ), whiteListedResourceTypes , severitiesPerClassification );
101103 Assertions .assertEquals (expectedValidator , factory .createValidator (null , settings ));
102104
103105 options = new HashMap <>();
104106 options .put ("maps" , "tccl:valid-classification.map" );
105107 // new option for whitelisting
106- options .put ("whitelistedResourcePathPatterns" , "/resourceType1/.*,/resourceType2" );
107- options .put ("severitiesPerClassification" , "INTERNAL=DEBUG" );
108+ options .put ("whitelistedResourcePathPatterns" , "/resourceType1/.*,/resourceType2, \n /resourceType3 " );
109+ options .put ("severitiesPerClassification" , "INTERNAL=DEBUG, \n INTERNAL_DEPRECATED=INFO " );
108110 settings = new ValidatorSettingsImpl (false , ValidationMessageSeverity .WARN , options );
109111 Assertions .assertEquals (expectedValidator , factory .createValidator (null , settings ));
110112
111113 // test with multiple validation maps including whitespaces in the maps string
112114 options = new HashMap <>();
113115 options .put ("maps" , "tccl:valid-classification.map,tccl:empty-map-1.map,\n \t tccl:empty-map-2.map" );
114- options .put ("whitelistedResourcePathPatterns" , "/resourceType1/.*,/resourceType2" );
115- options .put ("severitiesPerClassification" , "INTERNAL=DEBUG" );
116+ options .put ("whitelistedResourcePathPatterns" , "/resourceType1/.*,/resourceType2, \n /resourceType3 " );
117+ options .put ("severitiesPerClassification" , "INTERNAL=DEBUG, \n INTERNAL_DEPRECATED=INFO " );
116118 settings = new ValidatorSettingsImpl (false , ValidationMessageSeverity .WARN , options );
117119 ContentClassificationMap emptyMap = new ContentClassificationMapImpl ("" );
118120 expectedValidator = new AemClassificationValidator (ValidationMessageSeverity .WARN , new CompositeContentClassificationMap (map , emptyMap , emptyMap ), whiteListedResourceTypes , severitiesPerClassification );
0 commit comments