Search in sources :

Example 6 with MediaPackageBuilderImpl

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;
}
Also used : AccessControlList(org.opencastproject.security.api.AccessControlList) MediaPackageException(org.opencastproject.mediapackage.MediaPackageException) AuthorizationService(org.opencastproject.security.api.AuthorizationService) MediaPackageBuilderImpl(org.opencastproject.mediapackage.MediaPackageBuilderImpl) MediaPackage(org.opencastproject.mediapackage.MediaPackage) Attachment(org.opencastproject.mediapackage.Attachment) AttachmentImpl(org.opencastproject.mediapackage.attachment.AttachmentImpl)

Aggregations

MediaPackageBuilderImpl (org.opencastproject.mediapackage.MediaPackageBuilderImpl)6 MediaPackage (org.opencastproject.mediapackage.MediaPackage)5 Before (org.junit.Before)3 WorkflowInstanceImpl (org.opencastproject.workflow.api.WorkflowInstanceImpl)3 WorkflowOperationInstanceImpl (org.opencastproject.workflow.api.WorkflowOperationInstanceImpl)3 Job (org.opencastproject.job.api.Job)2 JobImpl (org.opencastproject.job.api.JobImpl)2 Attachment (org.opencastproject.mediapackage.Attachment)2 MediaPackageBuilder (org.opencastproject.mediapackage.MediaPackageBuilder)2 MediaPackageException (org.opencastproject.mediapackage.MediaPackageException)2 AttachmentImpl (org.opencastproject.mediapackage.attachment.AttachmentImpl)2 IdImpl (org.opencastproject.mediapackage.identifier.IdImpl)2 TrackImpl (org.opencastproject.mediapackage.track.TrackImpl)2 AccessControlList (org.opencastproject.security.api.AccessControlList)2 Workspace (org.opencastproject.workspace.api.Workspace)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 Date (java.util.Date)1