@Test public void resolveProperty() throws Exception { ObjectIdConverter converter = new ObjectIdConverter(); List<ModelConverter> others = new ArrayList<>(); Annotation[] annotations = new Annotation[]{}; Property property = converter.resolveProperty(ObjectId.class, null, annotations, others.iterator()); assertTrue(property instanceof StringProperty); assertEquals("588f7ee98f138b19220041a7", property.getExample()); }
@Override public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain) { final JavaType jType = Json.mapper().constructType(type); if (jType != null) { final Class<?> cls = jType.getRawClass(); if (cls.equals(ObjectId.class)) { StringProperty property = new StringProperty(); property.setExample("588f7ee98f138b19220041a7"); return property; } } if (chain.hasNext()) { return chain.next().resolveProperty(type, context, annotations, chain); } else { return null; } }
ObjectIdConverter implements ModelConverter { @Override public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain) { final JavaType jType = Json.mapper().constructType(type); if (jType != null) { final Class<?> cls = jType.getRawClass(); if (cls.equals(ObjectId.class)) { StringProperty property = new StringProperty(); property.setExample("588f7ee98f138b19220041a7"); return property; } } if (chain.hasNext()) { return chain.next().resolveProperty(type, context, annotations, chain); } else { return null; } } }
ObjectIdConverter implements ModelConverter { @Override public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain) { final JavaType jType = Json.mapper().constructType(type); if (jType != null) { final Class<?> cls = jType.getRawClass(); if (cls.equals(ObjectId.class)) { StringProperty property = new StringProperty(); property.setExample("588f7ee98f138b19220041a7"); return property; } } if (chain.hasNext()) { return chain.next().resolveProperty(type, context, annotations, chain); } else { return null; } }  }
ObjectIdConverter implements ModelConverter { @Override public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain) { final JavaType jType = Json.mapper().constructType(type); if (jType != null) { final Class<?> cls = jType.getRawClass(); if (cls.equals(ObjectId.class)) { StringProperty property = new StringProperty(); property.setExample("588f7ee98f138b19220041a7"); return property; } } if (chain.hasNext()) { return chain.next().resolveProperty(type, context, annotations, chain); } else { return null; } }  @Override Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain); @Override Model resolve(Type type, ModelConverterContext context, Iterator<ModelConverter> chain); }
ObjectIdConverter implements ModelConverter { @Override public Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain) { final JavaType jType = Json.mapper().constructType(type); if (jType != null) { final Class<?> cls = jType.getRawClass(); if (cls.equals(ObjectId.class)) { StringProperty property = new StringProperty(); property.setExample("588f7ee98f138b19220041a7"); return property; } } if (chain.hasNext()) { return chain.next().resolveProperty(type, context, annotations, chain); } else { return null; } }  @Override Property resolveProperty(Type type, ModelConverterContext context, Annotation[] annotations, Iterator<ModelConverter> chain); @Override Model resolve(Type type, ModelConverterContext context, Iterator<ModelConverter> chain);  }