Lucio Lelii 2016-02-15 11:38:51 +00:00
parent bde67c9244
commit 2021343b97
3 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package org.gcube.common.authorization.library;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
@ -33,7 +34,7 @@ public class AuthorizationEntry {
@XmlElementRef(type = Service2ServicePolicy.class),
@XmlElementRef(type = User2ServicePolicy.class),
})
private List<Policy> policies;
private List<Policy> policies = new ArrayList<Policy>();
protected AuthorizationEntry(){}

View File

@ -1,5 +1,6 @@
package org.gcube.common.authorization.library.provider;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
@ -17,7 +18,7 @@ public class UserInfo extends ClientInfo {
private static final long serialVersionUID = 1L;
private String clientId;
private List<String> roles = null;
private List<String> roles = new ArrayList<String>();
protected UserInfo(){}

View File

@ -33,6 +33,7 @@ public class AuthorizationEntryBinder {
context.createMarshaller().marshal(ae1, sw);
System.out.println(sw.toString());
AuthorizationEntry ae2 = (AuthorizationEntry)context.createUnmarshaller().unmarshal(new StringReader(sw.toString()));
System.out.println(ae2.toString());
Assert.assertEquals(ae1, ae2);
}
}