|
| 1 | +package com.fasterxml.jackson.databind.introspect; |
| 2 | + |
| 3 | +import java.util.List; |
| 4 | + |
| 5 | +import org.junit.jupiter.api.Test; |
| 6 | + |
| 7 | +import com.fasterxml.jackson.databind.*; |
| 8 | +import com.fasterxml.jackson.databind.testutil.DatabindTestUtil; |
| 9 | + |
| 10 | +// Tests for [databind#4584]: extension point for discovering "Canonical" |
| 11 | +// Creator (primary Creator, usually constructor, used in case no creator |
| 12 | +// explicitly annotated) |
| 13 | +// |
| 14 | +// @since 2.18 |
| 15 | +public class CanonicalCreator4584Test extends DatabindTestUtil |
| 16 | +{ |
| 17 | + static class POJO4584 { |
| 18 | + String value; |
| 19 | + |
| 20 | + // actually fundamentally canonical constructor... |
| 21 | + private POJO4584(String v, int bogus) { |
| 22 | + value = v; |
| 23 | + } |
| 24 | + |
| 25 | + public POJO4584(List<Object> bogus) { |
| 26 | + value = "List["+((bogus == null) ? -1 : bogus.size())+"]"; |
| 27 | + } |
| 28 | + |
| 29 | + public POJO4584(Object[] bogus) { |
| 30 | + value = "Array["+((bogus == null) ? -1 : bogus.length)+"]"; |
| 31 | + } |
| 32 | + |
| 33 | + public static POJO4584 factoryInt(int i) { |
| 34 | + return new POJO4584("int["+i+"]", 0); |
| 35 | + } |
| 36 | + |
| 37 | + public static POJO4584 factoryLong(long l) { |
| 38 | + return new POJO4584("long["+l+"]", 0); |
| 39 | + } |
| 40 | + } |
| 41 | + |
| 42 | + private final ObjectMapper MAPPER = newJsonMapper(); |
| 43 | + |
| 44 | + /* |
| 45 | + /********************************************************************** |
| 46 | + /* Test methods |
| 47 | + /********************************************************************** |
| 48 | + */ |
| 49 | + |
| 50 | + @Test |
| 51 | + public void testCanonicalConstructorPropertiesCreator() throws Exception { |
| 52 | + // TODO |
| 53 | + } |
| 54 | +} |
0 commit comments