private SessionInfo mockSessionInfo() { return new SessionInfoMock(); }
@Before public void setup() { final SessionInfoMock sessionInfo = new SessionInfoMock( "admin" ); final UsernameProvider usernameProvider = mock( UsernameProvider.class ); doReturn( sessionInfo.getIdentity().getIdentifier() ).when( usernameProvider ).get(); scopeTypes = new WorkbenchPreferenceScopeTypes( usernameProvider ); scopesFactory = new PreferenceScopeFactoryImpl( scopeTypes ); scopeResolutionStrategies = new WorkbenchPreferenceScopeResolutionStrategiesImpl( scopesFactory ); }
private SessionInfo mockSessionInfo() { return new SessionInfoMock(userScopeKey); }
@Before public void setup() { final SessionInfoMock sessionInfo = new SessionInfoMock( "admin" ); final UsernameProvider usernameProvider = mock( UsernameProvider.class ); doReturn( sessionInfo.getIdentity().getIdentifier() ).when( usernameProvider ).get(); scopeTypes = new WorkbenchPreferenceScopeTypes( usernameProvider ); scopesFactory = new PreferenceScopeFactoryImpl( scopeTypes ); defaultPreferenceScopeResolutionStrategy = new WorkbenchPreferenceScopeResolutionStrategy( scopesFactory, null, null ); }
private SessionInfo mockSessionInfo() { return new SessionInfoMock(); }
private SessionInfo mockSessionInfo() { return new SessionInfoMock(userScopeKey); }
@Before public void setup() { sessionInfo = spy(new SessionInfoMock()); serverUsernameProvider = new ClientUsernameProvider(sessionInfo); }
@Before public void setup() { sessionInfo = spy(new SessionInfoMock()); serverUsernameProvider = new ServerUsernameProvider(sessionInfo); }
@Before public void setup() { sessionInfo = spy(new SessionInfoMock()); serverUsernameProvider = new ServerUsernameProvider(sessionInfo); }
@Before public void setup() { sessionInfo = spy(new SessionInfoMock()); serverUsernameProvider = new ClientUsernameProvider(sessionInfo); }
@Before public void setup() { final SessionInfo sessionInfo = new SessionInfoMock(); final UsernameProvider usernameProvider = mock( UsernameProvider.class ); doReturn( sessionInfo.getIdentity().getIdentifier() ).when( usernameProvider ).get(); scopeTypes = new WorkbenchPreferenceScopeTypes( usernameProvider ); }
@Before public void setup() { sessionInfo = new SessionInfoMock("owner"); repositoryServiceCaller = new CallerMock<>(repositoryService); final OrganizationalUnit activeSpace = mock(OrganizationalUnit.class); doReturn(mock(Space.class)).when(activeSpace).getSpace(); doReturn(activeSpace).when(libraryPlaces).getActiveSpace(); final WorkspaceProject activeProject = mock(WorkspaceProject.class); final Repository activeRepository = mock(Repository.class); doReturn("alias").when(activeRepository).getAlias(); doReturn(activeRepository).when(activeProject).getRepository(); doReturn(activeProject).when(libraryPlaces).getActiveWorkspace(); service = new ProjectContributorsListServiceImpl(libraryPlaces, repositoryServiceCaller, spaceContributorsListService, sessionInfo, projectController, contributorsSecurityUtils); }
@Before public void setup() { sessionInfo = new SessionInfoMock("owner"); organizationalUnitServiceCaller = new CallerMock<>(organizationalUnitService); libraryServiceCaller = new CallerMock<>(libraryService); final OrganizationalUnit activeSpace = mock(OrganizationalUnit.class); doReturn(mock(Space.class)).when(activeSpace).getSpace(); doReturn(activeSpace).when(libraryPlaces).getActiveSpace(); service = new SpaceContributorsListServiceImpl(libraryPlaces, organizationalUnitServiceCaller, afterEditOrganizationalUnitEvent, libraryServiceCaller, sessionInfo, organizationalUnitController, contributorsSecurityUtils); }
@Before public void setup() { sessionInfo = new SessionInfoMock(); socialUserRepositoryAPICaller = new CallerMock<>(socialUserRepositoryAPI); socialEntryPoint = new SocialEntryPoint(sessionInfo, socialUserRepositoryAPICaller); }
@Before public void init() { when(editorInstance.get()).thenReturn(mock(ExperimentalFeatureEditor.class)); sessionInfo = new SessionInfoMock(USER_NAME); defRegistry = new TestExperimentalFeatureDefRegistry(); features = defRegistry.getAllFeatures().stream() .map(def -> new ExperimentalFeatureImpl(def.getId(), false)) .collect(Collectors.toList()); registry = new ExperimentalFeaturesRegistryImpl(features); when(registryService.getFeaturesRegistry()).thenReturn(registry); when(instance.get()).thenAnswer((Answer<ExperimentalFeaturesGroup>) invocationOnMock -> createGroup()); editorServiceCaller = new CallerMock<>(featuresEditorService); presenter = new ExperimentalFeaturesEditorScreen(translationService, registryService, defRegistry, view, instance, editorServiceCaller, sessionInfo, authorizationManager); }
@Before public void setup() { sessionInfo = new SessionInfoMock(); socialUserRepositoryAPICaller = new CallerMock<>(socialUserRepositoryAPI); socialEntryPoint = new SocialEntryPoint(sessionInfo, socialUserRepositoryAPICaller); }
@Before public void init() { when(editorInstance.get()).thenReturn(mock(ExperimentalFeatureEditor.class)); sessionInfo = new SessionInfoMock(USER_NAME); defRegistry = new TestExperimentalFeatureDefRegistry(); features = defRegistry.getAllFeatures().stream() .map(def -> new ExperimentalFeatureImpl(def.getId(), false)) .collect(Collectors.toList()); registry = new ExperimentalFeaturesRegistryImpl(features); when(registryService.getFeaturesRegistry()).thenReturn(registry); when(instance.get()).thenAnswer((Answer<ExperimentalFeaturesGroup>) invocationOnMock -> createGroup()); editorServiceCaller = new CallerMock<>(featuresEditorService); presenter = new ExperimentalFeaturesEditorScreen(translationService, registryService, defRegistry, view, instance, editorServiceCaller, sessionInfo, authorizationManager); }
@Before public void setUp() throws Exception { sessionInfo = new SessionInfoMock(); backward = new BackwardCompatibleUtil(configurationFactory); organizationalUnitFactory = spy(new OrganizationalUnitFactoryImpl(repositoryService, backward, spacesAPI, configurationService, configurationFactory)); organizationalUnitService = new OrganizationalUnitServiceImpl(configurationService, configurationFactory, organizationalUnitFactory, repoService, backward, newOrganizationalUnitEvent, removeOrganizationalUnitEvent, repoAddedToOrgUnitEvent, repoRemovedFromOrgUnitEvent, updatedOrganizationalUnitEvent, authorizationManager, spacesAPI, sessionInfo, ioService, configuredRepositories); organizationalUnitService.registeredOrganizationalUnits.put("A", orgUnit); when(authorizationManager.authorize(any(Resource.class), any(User.class))).thenReturn(false); }
@Before public void setUp() throws Exception { sessionInfo = new SessionInfoMock(); backward = new BackwardCompatibleUtil(configurationFactory); organizationalUnitFactory = spy(new OrganizationalUnitFactoryImpl(repositoryService, backward, spacesAPI, configurationService, configurationFactory)); organizationalUnitService = new OrganizationalUnitServiceImpl(configurationService, configurationFactory, organizationalUnitFactory, repoService, backward, newOrganizationalUnitEvent, removeOrganizationalUnitEvent, repoAddedToOrgUnitEvent, repoRemovedFromOrgUnitEvent, updatedOrganizationalUnitEvent, authorizationManager, spacesAPI, sessionInfo, ioService, configuredRepositories); organizationalUnitService.registeredOrganizationalUnits.put("A", orgUnit); when(authorizationManager.authorize(any(Resource.class), any(User.class))).thenReturn(false); }
libraryServiceCaller = new CallerMock<>(libraryService); validationServiceCaller = new CallerMock<>(validationService); sessionInfo = new SessionInfoMock();