From 4036de44f097566783ccc95e887a99df23ddd015 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Wed, 27 Jul 2022 11:01:43 +0200 Subject: [PATCH] fixed the test --- .classpath | 4 +-- .../TestClientServices.java | 30 ++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.classpath b/.classpath index b8c44f6..72e59e3 100644 --- a/.classpath +++ b/.classpath @@ -8,9 +8,9 @@ + - @@ -18,7 +18,7 @@ - + diff --git a/src/test/java/org/gcube/portal/social_networking_client_library/TestClientServices.java b/src/test/java/org/gcube/portal/social_networking_client_library/TestClientServices.java index 8f37eb7..608cd7f 100644 --- a/src/test/java/org/gcube/portal/social_networking_client_library/TestClientServices.java +++ b/src/test/java/org/gcube/portal/social_networking_client_library/TestClientServices.java @@ -52,8 +52,8 @@ public class TestClientServices { @Before public void setContextAndToken(){ - ScopeProvider.instance.set("/gcube/devsec/devVRE"); - String umaToken = ""; //the UMA Token + ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/gCube"); + String umaToken = ""; AccessTokenProvider.instance.set(umaToken); //SecurityTokenProvider.instance.set(""); } @@ -62,15 +62,17 @@ public class TestClientServices { @Test public void testCatalogueEvents() throws Exception { NotificationClient nc = new NotificationClient(); - String[] idstoNotify = {"andrea.rossi", "mister.pink"}; + String[] idstoNotify = {"andrea.rossi"}; CatalogueEvent event = new CatalogueEvent( CatalogueEventType.ITEM_SUBMITTED, idstoNotify, - "Wyscout soccer-logs dataset", - "submitted \"Wyscout soccer-logs dataset\", a dataset of soccer-logs for all the main soccer leagues in the world, from season 2014/2015 to the current one. ", - new URL("http://data.d4science.org/ctlg/ResourceCatalogue/wyscout_soccer-logs_dataset")); + "Submitted item RESTful Transaction Model", + "Giorgino Giorgetti created the item RESTful Transaction Model. You are kindly requested to review it and decide either to APPROVE or REJECT it. ", + new URL("https://data-dev.d4science.net/rU7T")); nc.sendCatalogueEvent(event); + + } @Test @@ -82,7 +84,7 @@ public class TestClientServices { FileItemBean fileItem = new FileItemBean("90b8da48-d363-441a-f0a2-4f413ae747d7", "updated item.pdf", "updated item.pdf", "/Workspace/_shared attachments/test updated item from client", folder); - String[] idstoNotify = {"andrea.rossi", "mister.pink"}; + String[] idstoNotify = {"andrea.rossi"}; WorkspaceEvent event = new UpdatedItemEvent(idstoNotify, fileItem); nc.sendWorkspaceEvent(event); event = new AddedItemEvent(idstoNotify, fileItem); @@ -90,7 +92,7 @@ public class TestClientServices { event = new DeletedItemEvent(idstoNotify, "theDeletedFilenName.pdf", folder); nc.sendWorkspaceEvent(event); - String[] contextIdstoNotify = {"/gcube/devsec/devVRE"}; + String[] contextIdstoNotify = {"/pred4s/preprod/preVRE"}; event = new UpdatedItemEvent(contextIdstoNotify, true, fileItem); nc.sendWorkspaceEvent(event); } @@ -146,7 +148,7 @@ public class TestClientServices { public void sendMessage() throws Exception{ logger.debug("Sending message "); MessageClient messagesClient = new MessageClient(); - List rec = Arrays.asList(new Recipient("andrea.rossi")); + List rec = Arrays.asList(new Recipient("andrea.rossi"), new Recipient("giancarlo.panichi")); Message message = new Message( "Test message", "Sending message via client " + System.currentTimeMillis(), @@ -199,8 +201,8 @@ public class TestClientServices { logger.debug("My Vres " + myVres); } - //@Test - public void UsersClientTests() throws Exception{ + @Test + public void TestUsersClient() throws Exception{ UserClient userClient = new UserClient(); @@ -336,7 +338,7 @@ public class TestClientServices { } - //@Test + @Test public void getPostsVRE() throws Exception{ PostClient postClient = new PostClient(); @@ -354,7 +356,7 @@ public class TestClientServices { } - //@Test + @Test public void getUserLikedPost() throws Exception{ PostClient postClient = new PostClient(); @@ -363,7 +365,7 @@ public class TestClientServices { } - //@Test + @Test public void getUserLikedPostIds() throws Exception{ PostClient postClient = new PostClient();