Skip to content
Snippets Groups Projects
Commit 257d531c authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XCOMMONS-3051: Introduce the Supported By concept in Extension Manager and Repository

* fix support plan test util
parent 58844e13
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,8 @@
import org.xwiki.extension.internal.converter.ExtensionIdConverter;
import org.xwiki.extension.test.RepositoryUtils;
import org.xwiki.model.EntityType;
import org.xwiki.model.internal.reference.DefaultSymbolScheme;
import org.xwiki.model.internal.reference.LocalStringEntityReferenceSerializer;
import org.xwiki.model.reference.EntityReference;
import org.xwiki.model.reference.LocalDocumentReference;
import org.xwiki.repository.internal.XWikiRepositoryModel;
......@@ -63,6 +65,9 @@ public class RepositoryTestUtils
private final static String SPACENAME_EXTENSION = "Extension";
private static final LocalStringEntityReferenceSerializer LOCAL_REFERENCE_SERIALIZER =
new LocalStringEntityReferenceSerializer(new DefaultSymbolScheme());
/**
* @since 7.3M1
*/
......@@ -87,6 +92,11 @@ public static org.xwiki.rest.model.jaxb.Object extensionObject(RemoteExtension e
authors.add(author.getName());
}
extensionObject.getProperties().add(property(XWikiRepositoryModel.PROP_EXTENSION_AUTHORS, authors));
List<String> supportPlans = new ArrayList<>();
for (ExtensionSupportPlan supportPlan : extension.getSupportPlans().getSupportPlans()) {
supportPlans.add(LOCAL_REFERENCE_SERIALIZER.serialize(toSupportPlanReference(supportPlan)));
}
extensionObject.getProperties().add(property(XWikiRepositoryModel.PROP_EXTENSION_SUPPORTPLANS, supportPlans));
extensionObject.getProperties()
.add(property(XWikiRepositoryModel.PROP_EXTENSION_WEBSITE, extension.getWebSite()));
if (extension.getAllowedNamespaces() != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment