use of org.opencastproject.mediapackage.MediaPackageBuilderImpl in project opencast by opencast.
the class TestRestService method newAuthorizationService.
private static AuthorizationService newAuthorizationService() {
AccessControlList acl = new AccessControlList();
Attachment attachment = new AttachmentImpl();
MediaPackage mediapackage;
try {
mediapackage = new MediaPackageBuilderImpl().createNew();
} catch (MediaPackageException e) {
throw new RuntimeException(e);
}
AuthorizationService authorizationService = EasyMock.createNiceMock(AuthorizationService.class);
EasyMock.expect(authorizationService.getActiveAcl((MediaPackage) EasyMock.anyObject())).andReturn(Tuple.tuple(acl, AclScope.Series)).anyTimes();
EasyMock.expect(authorizationService.setAcl((MediaPackage) EasyMock.anyObject(), (AclScope) EasyMock.anyObject(), (AccessControlList) EasyMock.anyObject())).andReturn(Tuple.tuple(mediapackage, attachment));
EasyMock.replay(authorizationService);
return authorizationService;
}
Aggregations