本文整理汇总了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));
}