@@ -56,7 +56,7 @@ void testValidateMissingAllowedValuesOption() {
5656 var configuration = new ValidationConfiguration ();
5757
5858 ApiException exception =
59- assertThrows (ApiException .class , () -> plugin .validate (configuration , "" ));
59+ assertThrows (ApiException .class , () -> plugin .validate (configuration , "test " ));
6060
6161 assertEquals (500 , exception .getStatusCode ());
6262 assertEquals ("error.plugin.default.missing.option" , exception .getError ().key ());
@@ -70,39 +70,35 @@ void testValidateInvalidAllowedValuesOption() {
7070 var configuration = new ValidationConfiguration ();
7171 configuration .addOption ("allowedValues" , "invalid" );
7272 ApiException exception =
73- assertThrows (ApiException .class , () -> plugin .validate (configuration , "" ));
73+ assertThrows (ApiException .class , () -> plugin .validate (configuration , "test " ));
7474
7575 assertEquals (500 , exception .getStatusCode ());
7676 assertEquals ("error.plugin.default.invalid.option" , exception .getError ().key ());
7777 assertEquals (Map .of ("option" , "allowedValues" ), exception .getError ().context ());
7878 }
7979
8080 @ Test
81- @ DisplayName ("test validate: should return message on null value" )
81+ @ DisplayName ("test validate: should accept null value" )
8282 void testValidateNullValue () {
8383 var plugin = new ListValidationPlugin ();
8484 var configuration = new ValidationConfiguration ();
85- configuration .addOption ("allowedValues" , new String [] {"TEST" });
8685
8786 var error = plugin .validate (configuration , null );
8887
8988 assertNotNull (error );
90- assertTrue (error .isPresent ());
91- assertEquals ("error.plugin.listValidation.invalid.value" , error .get ().key ());
89+ assertTrue (error .isEmpty ());
9290 }
9391
9492 @ Test
95- @ DisplayName ("test validate: should return message on empty string value" )
93+ @ DisplayName ("test validate: should accept empty string value" )
9694 void testValidateEmptyStringValue () {
9795 var plugin = new ListValidationPlugin ();
9896 var configuration = new ValidationConfiguration ();
99- configuration .addOption ("allowedValues" , new String [] {"TEST" });
10097
10198 var error = plugin .validate (configuration , "" );
10299
103100 assertNotNull (error );
104- assertTrue (error .isPresent ());
105- assertEquals ("error.plugin.listValidation.invalid.value" , error .get ().key ());
101+ assertTrue (error .isEmpty ());
106102 }
107103
108104 @ Test
0 commit comments