This commit is contained in:
Lucio Lelii 2016-11-25 14:11:16 +00:00
parent e0972c8291
commit b4c40c4507
2 changed files with 17 additions and 2 deletions

View File

@ -3,6 +3,9 @@
<Change>First Release</Change>
</Changeset>
<Changeset component="authorization-client-2.0.0" date="2016-09-30">
<Change>moving to auth2</Change>
<Change>moving to auth2 service</Change>
</Changeset>
<Changeset component="authorization-client-2.0.1" date="2016-11-25">
<Change>added calls for ExternalServiceToken generator</Change>
</Changeset>
</ReleaseNotes>

View File

@ -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 {