|
|
|
@ -38,6 +38,18 @@ public class CallTest {
|
|
|
|
|
System.out.println(authorizationService().resolveTokenByUserAndContext("alessandro.pieve", "/gcube/devsec"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void requestExternalServiceToken() throws Exception {
|
|
|
|
|
SecurityTokenProvider.instance.set(requestTestToken("/gcube/devsec"));
|
|
|
|
|
System.out.println(authorizationService().generateExternalServiceToken("OBISTest"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void getExternalServiceToken() throws Exception {
|
|
|
|
|
SecurityTokenProvider.instance.set(requestTestToken("/gcube/devsec"));
|
|
|
|
|
System.out.println(authorizationService().retrieveExternalServiceGenerated());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void requestNodeToken() throws Exception {
|
|
|
|
|
System.out.println(_requestNodeToken());
|
|
|
|
@ -66,7 +78,7 @@ public class CallTest {
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void generateToken() throws Exception{
|
|
|
|
|
System.out.println(authorizationService().generateUserToken(new UserInfo("alessandro.pieve", new ArrayList<String>()), "/gcube/devsec"));
|
|
|
|
|
System.out.println(authorizationService().generateUserToken(new UserInfo("alessandro.pieve", new ArrayList<String>()), "/gcube/devNext"));
|
|
|
|
|
}
|
|
|
|
|
@Test(expected=RuntimeException.class)
|
|
|
|
|
public void createKeyWithError() throws Exception {
|
|
|
|
|