2424import com .fasterxml .jackson .databind .ObjectMapper ;
2525import com .fasterxml .jackson .databind .ObjectReader ;
2626import com .fasterxml .jackson .databind .ObjectWriter ;
27- import com .fasterxml .jackson .databind .json .JsonMapper ;
2827import com .jayway .jsonpath .Configuration ;
2928import com .jayway .jsonpath .spi .json .JacksonJsonProvider ;
3029import com .jayway .jsonpath .spi .mapper .JacksonMappingProvider ;
3534import org .springframework .util .Assert ;
3635
3736/**
38- * AssertJ based JSON tester backed by Jackson. Usually instantiated via
39- * {@link #initFields(Object, JsonMapper )}, for example: <pre class="code">
37+ * AssertJ based JSON tester backed by Jackson 2 . Usually instantiated via
38+ * {@link #initFields(Object, ObjectMapper )}, for example: <pre class="code">
4039 * public class ExampleObjectJsonTests {
4140 *
42- * private JacksonTester <ExampleObject> json;
41+ * private Jackson2Tester <ExampleObject> json;
4342 *
4443 * @Before
4544 * public void setup() {
46- * JsonMapper jsonMapper = new JsonMapper ();
47- * JacksonTester.initFields(this, jsonMapper );
45+ * ObjectMapper objectMapper = new ObjectMapper ();
46+ * JacksonTester.initFields(this, objectMapper );
4847 * }
4948 *
5049 * @Test
@@ -156,24 +155,22 @@ private JavaType getType(ResolvableType type) {
156155 * Utility method to initialize {@link Jackson2Tester} fields. See
157156 * {@link Jackson2Tester class-level documentation} for example usage.
158157 * @param testInstance the test instance
159- * @param jsonMapper the JSON mapper
160- * @since 4.0.0
161- * @see #initFields(Object, JsonMapper)
158+ * @param objectMapper the JSON mapper
159+ * @see #initFields(Object, ObjectMapper)
162160 */
163- public static void initFields (Object testInstance , JsonMapper jsonMapper ) {
164- new Jackson2FieldInitializer ().initFields (testInstance , jsonMapper );
161+ public static void initFields (Object testInstance , ObjectMapper objectMapper ) {
162+ new Jackson2FieldInitializer ().initFields (testInstance , objectMapper );
165163 }
166164
167165 /**
168166 * Utility method to initialize {@link Jackson2Tester} fields. See
169167 * {@link Jackson2Tester class-level documentation} for example usage.
170168 * @param testInstance the test instance
171- * @param jsonMapperFactory a factory to create the JSON mapper
172- * @since 4.0.0
173- * @see #initFields(Object, JsonMapper)
169+ * @param objectMapperFactory a factory to create the object mapper
170+ * @see #initFields(Object, ObjectMapper)
174171 */
175- public static void initFields (Object testInstance , ObjectFactory <JsonMapper > jsonMapperFactory ) {
176- new Jackson2FieldInitializer ().initFields (testInstance , jsonMapperFactory );
172+ public static void initFields (Object testInstance , ObjectFactory <ObjectMapper > objectMapperFactory ) {
173+ new Jackson2FieldInitializer ().initFields (testInstance , objectMapperFactory );
177174 }
178175
179176 /**
@@ -193,15 +190,15 @@ public Jackson2Tester<T> forView(Class<?> view) {
193190 /**
194191 * {@link FieldInitializer} for Jackson.
195192 */
196- private static class Jackson2FieldInitializer extends FieldInitializer <JsonMapper > {
193+ private static class Jackson2FieldInitializer extends FieldInitializer <ObjectMapper > {
197194
198195 protected Jackson2FieldInitializer () {
199196 super (Jackson2Tester .class );
200197 }
201198
202199 @ Override
203200 protected AbstractJsonMarshalTester <Object > createTester (Class <?> resourceLoadClass , ResolvableType type ,
204- JsonMapper marshaller ) {
201+ ObjectMapper marshaller ) {
205202 return new Jackson2Tester <>(resourceLoadClass , type , marshaller );
206203 }
207204
0 commit comments