@@ -84,7 +84,8 @@ void coercesIntegerProperty() {
8484 ObjectSchema bodySchema = anObjectSchema (Map .of ("age" , intSchema ));
8585
8686 Map <String , Object > out =
87- parser .parseAndCoerce ("age=30" .getBytes (StandardCharsets .UTF_8 ), null , bodySchema );
87+ FormBodyCoercion .coerce (
88+ parser .parse ("age=30" .getBytes (StandardCharsets .UTF_8 ), null ), bodySchema );
8889
8990 assertThat (out ).containsExactly (Map .entry ("age" , 30L ));
9091 }
@@ -96,7 +97,8 @@ void coercesArrayOfIntegersProperty() {
9697 ObjectSchema bodySchema = anObjectSchema (Map .of ("ids" , arrSchema ));
9798
9899 Map <String , Object > out =
99- parser .parseAndCoerce ("ids=1&ids=2" .getBytes (StandardCharsets .UTF_8 ), null , bodySchema );
100+ FormBodyCoercion .coerce (
101+ parser .parse ("ids=1&ids=2" .getBytes (StandardCharsets .UTF_8 ), null ), bodySchema );
100102
101103 assertThat (out ).containsExactly (Map .entry ("ids" , List .of (1L , 2L )));
102104 }
@@ -108,7 +110,8 @@ void coercionFailureThrowsValidationExceptionAtPropertyPointer() {
108110
109111 org .assertj .core .api .Assertions .assertThatThrownBy (
110112 () ->
111- parser .parseAndCoerce ("age=abc" .getBytes (StandardCharsets .UTF_8 ), null , bodySchema ))
113+ FormBodyCoercion .coerce (
114+ parser .parse ("age=abc" .getBytes (StandardCharsets .UTF_8 ), null ), bodySchema ))
112115 .isInstanceOf (com .retailsvc .http .ValidationException .class )
113116 .extracting ("error.pointer" , "error.keyword" )
114117 .containsExactly ("/age" , "type" );
@@ -119,7 +122,8 @@ void unknownPropertyPassesThroughUnchanged() {
119122 ObjectSchema bodySchema = anObjectSchema (Map .of ());
120123
121124 Map <String , Object > out =
122- parser .parseAndCoerce ("anything=v" .getBytes (StandardCharsets .UTF_8 ), null , bodySchema );
125+ FormBodyCoercion .coerce (
126+ parser .parse ("anything=v" .getBytes (StandardCharsets .UTF_8 ), null ), bodySchema );
123127
124128 assertThat (out ).containsExactly (Map .entry ("anything" , "v" ));
125129 }
@@ -129,7 +133,8 @@ void nonObjectSchemaReturnsRawMap() {
129133 StringSchema strSchema = aStringSchema ();
130134
131135 Map <String , Object > out =
132- parser .parseAndCoerce ("a=1" .getBytes (StandardCharsets .UTF_8 ), null , strSchema );
136+ FormBodyCoercion .coerce (
137+ parser .parse ("a=1" .getBytes (StandardCharsets .UTF_8 ), null ), strSchema );
133138
134139 assertThat (out ).containsExactly (Map .entry ("a" , "1" ));
135140 }
0 commit comments