Skip to content

Commit fbce266

Browse files
committed
Start work on #3060
1 parent 48509f3 commit fbce266

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

src/test/java/com/fasterxml/jackson/databind/introspect/IntrospectorPairTest.java

+50
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,27 @@ public String findTypeName(AnnotatedClass ac) {
197197
return (String) values.get("findTypeName");
198198
}
199199

200+
/*
201+
/******************************************************
202+
/* Serialization introspection
203+
/******************************************************
204+
*/
205+
206+
@Override
207+
public Boolean hasAsKey(MapperConfig<?> config, Annotated a) {
208+
return (Boolean) values.get("hasAsKey");
209+
}
210+
211+
@Override
212+
public Boolean hasAsValue(Annotated a) {
213+
return (Boolean) values.get("hasAsValue");
214+
}
215+
216+
@Override
217+
public Boolean hasAnyGetter(Annotated ann) {
218+
return (Boolean) values.get("hasAnyGetter");
219+
}
220+
200221
/*
201222
/******************************************************
202223
/* Deserialization introspection
@@ -378,6 +399,35 @@ public void testFindSerializer() throws Exception
378399
assertNull(new AnnotationIntrospectorPair(nop2, nop).findSerializer(null));
379400
}
380401

402+
public void testHasAsValue() throws Exception
403+
{
404+
IntrospectorWithMap intr1 = new IntrospectorWithMap()
405+
.add("hasAsValue", Boolean.TRUE);
406+
IntrospectorWithMap intr2 = new IntrospectorWithMap()
407+
.add("hasAsValue", Boolean.FALSE);
408+
assertNull(new AnnotationIntrospectorPair(NO_ANNOTATIONS, NO_ANNOTATIONS)
409+
.hasAsValue(null));
410+
assertEquals(Boolean.TRUE, new AnnotationIntrospectorPair(intr1, NO_ANNOTATIONS)
411+
.hasAsValue(null));
412+
assertEquals(Boolean.TRUE, new AnnotationIntrospectorPair(NO_ANNOTATIONS, intr1)
413+
.hasAsValue(null));
414+
assertEquals(Boolean.FALSE, new AnnotationIntrospectorPair(intr2, NO_ANNOTATIONS)
415+
.hasAsValue(null));
416+
assertEquals(Boolean.FALSE, new AnnotationIntrospectorPair(NO_ANNOTATIONS, intr2)
417+
.hasAsValue(null));
418+
419+
assertEquals(Boolean.TRUE, new AnnotationIntrospectorPair(intr1, intr2)
420+
.hasAsValue(null));
421+
assertEquals(Boolean.FALSE, new AnnotationIntrospectorPair(intr2, intr1)
422+
.hasAsValue(null));
423+
}
424+
425+
/*
426+
/**********************************************************
427+
/* Test methods, deser
428+
/**********************************************************
429+
*/
430+
381431
public void testFindDeserializer() throws Exception
382432
{
383433
final JsonDeserializer<?> deserString = StringDeserializer.instance;

0 commit comments

Comments
 (0)