Search in sources :

Example 1 with UsernameProvider

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

the class WorkbenchPreferenceScopeTypesTest method setup.

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

Example 2 with UsernameProvider

use of org.uberfire.preferences.shared.UsernameProvider 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 3 with UsernameProvider

use of org.uberfire.preferences.shared.UsernameProvider 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)3 SessionInfoMock (org.uberfire.mocks.SessionInfoMock)3 UsernameProvider (org.uberfire.preferences.shared.UsernameProvider)3 PreferenceScopeFactoryImpl (org.uberfire.preferences.shared.impl.PreferenceScopeFactoryImpl)2 SessionInfo (org.uberfire.rpc.SessionInfo)1