本文整理匯總了Java中org.oscm.app.ui.appconfiguration.AppConfigurationCtrl類的典型用法代碼示例。如果您正苦於以下問題:Java AppConfigurationCtrl類的具體用法?Java AppConfigurationCtrl怎麽用?Java AppConfigurationCtrl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AppConfigurationCtrl類屬於org.oscm.app.ui.appconfiguration包,在下文中一共展示了AppConfigurationCtrl類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setup
import org.oscm.app.ui.appconfiguration.AppConfigurationCtrl; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Before
public void setup() throws Exception {
facesContext = mock(FacesContext.class);
externalContext = Mockito.mock(ExternalContext.class);
httpSession = Mockito.mock(HttpSession.class);
request = Mockito.mock(HttpServletRequest.class);
Mockito.when(facesContext.getExternalContext()).thenReturn(
externalContext);
Mockito.when(externalContext.getSession(Matchers.anyBoolean()))
.thenReturn(httpSession);
Mockito.when(externalContext.getRequest()).thenReturn(request);
Mockito.when(httpSession.getAttribute(Matchers.anyString()))
.thenReturn("mockUserId");
doReturn(session).when(request).getSession();
session = mock(HttpSession.class);
Application application = mock(Application.class);
when(facesContext.getApplication()).thenReturn(application);
when(application.getDefaultLocale()).thenReturn(Locale.FRANCE);
initialContext = mock(InitialContext.class);
model = new AppConfigurationModel();
ctrl = new AppConfigurationCtrl() {
@Override
protected FacesContext getFacesContext() {
return facesContext;
}
@Override
protected InitialContext getInitialContext() {
return initialContext;
}
};
ctrl.setModel(model);
appConfigService = mock(APPConfigurationServiceBean.class);
when(ctrl.getAppConfigService()).thenReturn(appConfigService);
appTimerService = mock(APPTimerServiceBean.class);
when(ctrl.getAPPTimerService()).thenReturn(appTimerService);
items.clear();
items.put("key1", "value1");
items.put("key2", "value2");
doNothing().when(appConfigService).storeControllerOrganizations(
any(HashMap.class));
}