Implementing new Solution refs #13207

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/social-networking/social-util-library@176785 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2019-01-24 11:07:06 +00:00
parent 2cf0d20a63
commit c8387db64c
2 changed files with 11 additions and 0 deletions

View File

@ -12,6 +12,10 @@ public class SanitizedURL {
protected final URL url;
public SanitizedURL(String urlString) throws MalformedURLException {
if(urlString==null || urlString.compareTo("")==0) {
throw new MalformedURLException();
}
prefix = "";
if(urlString.startsWith("(")) {
prefix = urlString.substring(0, 1);

View File

@ -1,9 +1,11 @@
package org.gcube.social_networking.socialutillibrary;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.widgets.pickitem.shared.ItemBean;
import org.gcube.socialnetworking.socialtoken.SanitizedURL;
import org.gcube.socialnetworking.socialtoken.SocialMessageParser;
import org.junit.Test;
import org.slf4j.Logger;
@ -91,4 +93,9 @@ public class MessageParserTest {
logger.debug(messageParser.getParsedMessage());
}
@Test(expected=MalformedURLException.class)
public void auxTest() throws MalformedURLException {
new SanitizedURL(null);
}
}