RestUtils { public static XmlId createXMLid(String name) { return new XmlId(RestUtils.createXmlIdAsString(name), false); }  static XmlId createXMLid(String name); static String createXmlIdAsString(String name); static Response getDefinitionsOfSelectedResource(final AbstractComponentInstanceResource resource, final URI uri); static Response getCsarOfSelectedResource(final AbstractComponentInstanceResource resource, CsarExportOptions options); static Response getYamlOfSelectedResource(DefinitionsChildId id); static Response getYamlCSARofSelectedResource(final AbstractComponentInstanceResource resource); static Response getEdmmModel(TServiceTemplate element, boolean useAbsolutPaths); static Response getZippedContents(final GenericId id); static Response getZippedContents(final GenericId id, String name); static String getTypeForComponentContainer(Class<? extends AbstractComponentsResource> containerClass); static Class<? extends DefinitionsChildId> getComponentIdClassForComponentContainer(Class<? extends AbstractComponentsResource> containerClass); static String getAbsoluteURL(GenericId id); static String getAbsoluteURL(RepositoryFileReference ref); static URI getAbsoluteURI(GenericId id); static String getIntermediateLocationStringForType(String type, String separator); static Response getXML(Class<T> clazz, T obj); static Response getResponseForException(Exception e); static boolean isSuccessFulResponse(Response res); static boolean isResourceAvailable(String path); static Set<String> clean(Set<String> set); static Set<QName> cleanQNameSet(Set<QName> set); static ServiceTemplateId cloneServiceTemplate(ServiceTemplateId serviceTemplate, String newName, String artifactName); static boolean containsNodeType(TServiceTemplate serviceTemplate, QName nodeType); static boolean containsNodeTypes(TServiceTemplate serviceTemplate, Collection<QName> nodeTypes); static boolean containsTag(TServiceTemplate serviceTemplate, String tagKey); static boolean containsTag(TServiceTemplate serviceTemplate, String tagKey, String tagValue); static boolean containsTags(TServiceTemplate serviceTemplate, Collection<String> tags); static ArtifactTemplateId createArtifactTemplate(InputStream uploadedInputStream, FormDataContentDisposition fileDetail, FormDataBodyPart body, QName artifactType, UriInfo uriInfo); static String getTagValue(TServiceTemplate serviceTemplate, String tagKey); static boolean hasDA(ServiceTemplateId serviceTemplate, String nodeTemplateId, String deploymentArtifactId); static Response persist(IPersistable res); static Response persist(Application application, RepositoryFileReference data_xml_ref, String mimeType); static Response.ResponseBuilder persistWithResponseBuilder(IPersistable res); static ResourceResult rename(DefinitionsChildId oldId, DefinitionsChildId newId); static Response renameAllVersionsOfOneDefinition(DefinitionsChildId oldId, DefinitionsChildId newId); static Response delete(Class<? extends DefinitionsChildId> definitionsChildIdClazz, String namespaceStr); static Response delete(GenericId id); static Response delete(RepositoryFileReference ref); static ResourceResult create(GenericId id, String name); static Response returnRepoPath(RepositoryFileReference ref, String modified); static Response putContentToFile(RepositoryFileReference ref, String content, MediaType mediaType); static Response putContentToFile(RepositoryFileReference ref, InputStream inputStream, org.apache.tika.mime.MediaType mediaType); static Response putContentToFile(RepositoryFileReference ref, InputStream inputStream, MediaType mediaType); static String getColor(String name, QName qname, Map<QName, String> otherAttributes); static QName getType(IPersistable res); static List<NamespaceAndDefinedLocalNamesForAngular> convert(List<NamespaceAndDefinedLocalNames> list); static ResourceResult duplicate(DefinitionsChildId oldComponent, DefinitionsChildId newComponent); static Response addNewVersion(DefinitionsChildId oldId, DefinitionsChildId newComponent, List<QNameWithTypeApiData> componentsToUpdate); static Response releaseVersion(DefinitionsChildId releasableComponent); static ResourceResult freezeVersion(DefinitionsChildId componentToCommit); static List<QNameApiData> getAllElementsReferencingGivenType(Class<X> clazz, QName qNameOfTheType); static List<ComponentId> getListOfIds(Set<? extends DefinitionsChildId> allDefinitionsChildIds,
                                                 boolean includeFullDefinitions, boolean includeVersions); static Definitions getFullComponentData(DefinitionsChildId id);  }
@Test public void testCreateID() { assertEquals("Frank-s-test", RestUtils.createXMLid("Frank's test").getDecoded()); assertEquals("MyNodeType", RestUtils.createXMLid("MyNodeType").getDecoded()); assertEquals("A-Node-Type", RestUtils.createXMLid("A Node Type").getDecoded()); }