Search in sources :

Example 1 with PreferenceScopeFactoryImpl

use of org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl in project kie-wb-common by kiegroup.

the class WorkbenchPreferenceScopeResolutionStrategyTest method setup.

@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);
}
Also used : SessionInfoMock(org.uberfire.mocks.SessionInfoMock) PreferenceScopeFactoryImpl(org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl) UsernameProvider(org.uberfire.preferences.shared.UsernameProvider) Before(org.junit.Before)

Example 2 with PreferenceScopeFactoryImpl

use of org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl in project kie-wb-common by kiegroup.

the class WorkbenchPreferenceScopeResolutionStrategiesImplTest method setup.

@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);
}
Also used : SessionInfoMock(org.uberfire.mocks.SessionInfoMock) PreferenceScopeFactoryImpl(org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl) UsernameProvider(org.uberfire.preferences.shared.UsernameProvider) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 SessionInfoMock (org.uberfire.mocks.SessionInfoMock)2 UsernameProvider (org.uberfire.preferences.shared.UsernameProvider)2 PreferenceScopeFactoryImpl (org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl)2