Search in sources :

Example 1 with HostRegistrationInMemory

use of org.opencastproject.serviceregistry.api.HostRegistrationInMemory in project opencast by opencast.

the class YouTubeV3PublicationServiceImplTest method before.

@Before
public void before() throws Exception {
    youTubeService = createMock(YouTubeAPIVersion3Service.class);
    youTubeService.initialize(anyObject(ClientCredentials.class));
    expectLastCall();
    orgDirectory = createMock(OrganizationDirectoryService.class);
    security = createMock(SecurityService.class);
    registry = createMock(ServiceRegistry.class);
    List<HostRegistration> hosts = new LinkedList<HostRegistration>();
    HostRegistration host = new HostRegistrationInMemory("localhost", "localhost", 1.0F, 1, 1024L);
    hosts.add(host);
    expect(registry.getHostRegistrations()).andReturn(hosts).anyTimes();
    userDirectoryService = createMock(UserDirectoryService.class);
    workspace = createMock(Workspace.class);
    // 
    service = new YouTubeV3PublicationServiceImpl(youTubeService);
    service.setOrganizationDirectoryService(orgDirectory);
    service.setSecurityService(security);
    service.setServiceRegistry(registry);
    service.setUserDirectoryService(userDirectoryService);
    service.setWorkspace(workspace);
}
Also used : HostRegistrationInMemory(org.opencastproject.serviceregistry.api.HostRegistrationInMemory) SecurityService(org.opencastproject.security.api.SecurityService) HostRegistration(org.opencastproject.serviceregistry.api.HostRegistration) ServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry) ClientCredentials(org.opencastproject.publication.youtube.auth.ClientCredentials) LinkedList(java.util.LinkedList) OrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService) UserDirectoryService(org.opencastproject.security.api.UserDirectoryService) Workspace(org.opencastproject.workspace.api.Workspace) Before(org.junit.Before)

Aggregations

LinkedList (java.util.LinkedList)1 Before (org.junit.Before)1 ClientCredentials (org.opencastproject.publication.youtube.auth.ClientCredentials)1 OrganizationDirectoryService (org.opencastproject.security.api.OrganizationDirectoryService)1 SecurityService (org.opencastproject.security.api.SecurityService)1 UserDirectoryService (org.opencastproject.security.api.UserDirectoryService)1 HostRegistration (org.opencastproject.serviceregistry.api.HostRegistration)1 HostRegistrationInMemory (org.opencastproject.serviceregistry.api.HostRegistrationInMemory)1 ServiceRegistry (org.opencastproject.serviceregistry.api.ServiceRegistry)1 Workspace (org.opencastproject.workspace.api.Workspace)1