@Test void convertToExtensionAllowedOnRoot() throws SecurityException { Model model = new Model(); model.setGroupId("groupid"); model.setArtifactId("artifactid"); model.setVersion("version"); model.addProperty(Extension.IKEYPREFIX + Extension.FIELD_NAMESPACES, "{root}"); Extension extension = this.converter.convert(Extension.class, model); assertEquals(Arrays.asList("{root}"), new ArrayList<>(extension.getAllowedNamespaces())); }
@Override public <G> G convert(Type targetType, Object sourceValue) { if (targetType == Extension.class) { return (G) convertToExtension((Model) sourceValue); } else { throw new ConversionException(String.format("Unsupported target type [%s]", targetType)); } }
ModelConverter extends AbstractModelConverter<Model> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (targetType == Extension.class) { return (G) convertToExtension((Model) sourceValue); } else { throw new ConversionException(String.format("Unsupported target type [%s]", targetType)); } } }
ModelConverter extends AbstractModelConverter<Model> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (targetType == Extension.class) { return (G) convertToExtension((Model) sourceValue); } else { throw new ConversionException(String.format("Unsupported target type [%s]", targetType)); } }  }
ModelConverter extends AbstractModelConverter<Model> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (targetType == Extension.class) { return (G) convertToExtension((Model) sourceValue); } else { throw new ConversionException(String.format("Unsupported target type [%s]", targetType)); } }  @Override G convert(Type targetType, Object sourceValue); }
ModelConverter extends AbstractModelConverter<Model> { @Override public <G> G convert(Type targetType, Object sourceValue) { if (targetType == Extension.class) { return (G) convertToExtension((Model) sourceValue); } else { throw new ConversionException(String.format("Unsupported target type [%s]", targetType)); } }  @Override G convert(Type targetType, Object sourceValue); static final ParameterizedType ROLE; }