diff --git a/src/main/java/org/gcube/gcat/social/SocialPost.java b/src/main/java/org/gcube/gcat/social/SocialPost.java index c54eacb..6ca514d 100644 --- a/src/main/java/org/gcube/gcat/social/SocialPost.java +++ b/src/main/java/org/gcube/gcat/social/SocialPost.java @@ -182,7 +182,7 @@ public class SocialPost extends Thread { GXHTTPStringRequest gxhttpStringRequest = GXHTTPStringRequest.newRequest(basePath); gxhttpStringRequest.from(Constants.CATALOGUE_NAME); gxhttpStringRequest.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON); - gxhttpStringRequest.setSecurityToken(Constants.getCatalogueSecurityToken()); + gxhttpStringRequest.setSecurityToken(Constants.getCatalogueSecret().getToken()); gxhttpStringRequest.path(SOCIAL_SERVICE_WRITE_APPLICATION_POST_PATH); HttpURLConnection httpURLConnection = gxhttpStringRequest.post(objectMapper.writeValueAsString(objectNode)); diff --git a/src/test/java/org/gcube/gcat/ContextTest.java b/src/test/java/org/gcube/gcat/ContextTest.java index 77b2c60..41f9de8 100644 --- a/src/test/java/org/gcube/gcat/ContextTest.java +++ b/src/test/java/org/gcube/gcat/ContextTest.java @@ -8,8 +8,8 @@ import java.io.InputStream; import java.util.Properties; import org.gcube.common.authorization.utils.manager.SecretManager; -import org.gcube.common.authorization.utils.secret.GCubeSecret; import org.gcube.common.authorization.utils.secret.Secret; +import org.gcube.common.authorization.utils.secret.SecretUtility; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -42,7 +42,6 @@ public class ContextTest { ROOT = "/gcube"; VO = ROOT + "/devsec"; VRE = VO + "/devVRE"; - } public static void set(Secret secret) throws Exception { @@ -61,7 +60,7 @@ public class ContextTest { } private static Secret getSecret(String token) throws Exception { - GCubeSecret secret = new GCubeSecret(token); + Secret secret = SecretUtility.getSecretByTokenString(token); return secret; }