This commit is contained in:
Lucio Lelii 2016-07-05 13:15:40 +00:00
parent 645835d36a
commit 868376896b
2 changed files with 5 additions and 6 deletions

View File

@ -39,7 +39,7 @@ public class DefaultAuthorizationProxy implements AuthorizationProxy {
private Map<Integer, AuthorizationEndpoint> endpoints;
private static final String TOKEN_SEPARATOR ="|";
private static final String TOKEN_SEPARATOR ="\\|";
public DefaultAuthorizationProxy() {
endpoints = AuthorizationEndpointScanner.endpoints();
@ -137,7 +137,7 @@ public class DefaultAuthorizationProxy implements AuthorizationProxy {
String hashCodeAsString = token.split(TOKEN_SEPARATOR)[1];
return Integer.parseInt(hashCodeAsString);
}catch(Exception e){
throw new RuntimeException("invalid token");
throw new RuntimeException("invalid token",e);
}
}

View File

@ -20,7 +20,7 @@ public class CallTest {
@Test
public void call() throws Exception{
try{
AuthorizationEntry entry = authorizationService().get("3b34750e-d39b-4d3c-924d-efcf7cc907c1");
AuthorizationEntry entry = authorizationService().get("f068c06b-dad9-4007-a3c6-020560116a59|98187548");
System.out.println(entry);
}catch(ObjectNotFound onf){
@ -31,9 +31,8 @@ public class CallTest {
@Test
public void requestToken() throws Exception {
for (int i=0; i<4000; i++){
System.out.println( authorizationService().generateToken(new UserInfo("ckanTestRec"+i, new ArrayList<String>()), "/gcube"));
}
System.out.println( authorizationService().generateToken(new UserInfo("valentina.marioli", new ArrayList<String>()), "/gcube"));
}
@Test