added few junit tests more

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/social-networking/social-networking-client-library@163357 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2018-02-17 19:08:15 +00:00
parent a9af0c0d3c
commit 6a4a66047f
1 changed files with 25 additions and 2 deletions

View File

@ -11,12 +11,14 @@ import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.portal.databook.shared.EnhancedFeed;
import org.gcube.portal.databook.shared.JobStatusType;
import org.gcube.portal.databook.shared.Notification;
import org.gcube.portal.socialnetworking.model.input.ApplicationId;
import org.gcube.portal.socialnetworking.model.input.JobNotificationBean;
import org.gcube.portal.socialnetworking.model.input.Message;
import org.gcube.portal.socialnetworking.model.input.Recipient;
import org.json.JSONArray;
import org.json.JSONObject;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -59,7 +61,7 @@ public class TestClientServices {
logger.debug("Returned tags " + hashtagsCount);
}
@Test
//@Test
public void testMessagesReceived() throws Exception {
MessagesClient messagesClient = new MessagesClient();
List<Message> receivedMessages = messagesClient.getReceivedMessages();
@ -113,6 +115,27 @@ public class TestClientServices {
logger.debug("Sent job notification ");
}
//@Test
public void getProfile() throws Exception {
PeopleClient getProfile = new PeopleClient();
JSONObject profile = getProfile.getProfile();
logger.debug("Profile retrieved is " + profile);
}
//@Test
public void generateAppToken() throws Exception {
TokensClient tokenClient = new TokensClient();
String token = tokenClient.generateApplicationToken(new ApplicationId("test_app"));
logger.debug("Generated token is " + token);
}
//@Test
public void getMyVres() throws Exception{
VREsClient myVresClient = new VREsClient();
JSONArray myVres = myVresClient.getMyVRES();
logger.debug("My Vres " + myVres);
}
@After
public void reset(){
ScopeProvider.instance.reset();