@Test public void resolveViewNameNoDeviceNoSitePreferenceNormalPrefixAndSuffix() throws Exception { viewResolver.setNormalPrefix("normal/"); viewResolver.setNormalSuffix(".nor"); replayMocks("normal/" + viewName + ".nor"); }
@Test public void resolveViewNameNoDeviceNoSitePreferenceNormalPrefix() throws Exception { viewResolver.setNormalPrefix("normal/"); replayMocks("normal/" + viewName); }
@Test public void resolveViewNameNoDeviceNoSitePreferenceNormalSuffix() throws Exception { viewResolver.setNormalSuffix(".norm"); replayMocks(viewName + ".norm"); }
@Test public void resolveViewNameTabletDeviceNoSitePreferenceTabletPrefixAndSuffix() throws Exception { device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setTabletPrefix("tablet/"); viewResolver.setTabletSuffix(".tab"); replayMocks("tablet/" + viewName + ".tab"); }
@Test public void resolveViewNameTabletDeviceTabletPrefixRedirectToRoot() throws Exception { this.viewName = "redirect:/"; device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setTabletPrefix("tablet/"); replayMocks("redirect:/"); }
@Test public void resolveViewNameMobileDeviceMobilePrefixForward() throws Exception { this.viewName = "forward:about"; device.setDeviceType(DeviceType.MOBILE); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setMobilePrefix("mobile/"); replayMocks("forward:about"); }
@Test public void resolveViewNameTabletDeviceTabletSuffixRedirect() throws Exception { this.viewName = "redirect:about"; device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setTabletSuffix(".tab"); replayMocks("redirect:about"); }
@Test public void resolveViewNameMobileDeviceMobileSuffixRedirect() throws Exception { this.viewName = "redirect:about"; device.setDeviceType(DeviceType.MOBILE); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setMobileSuffix(".mob"); replayMocks("redirect:about"); }
@Test public void resolveViewNameNoDeviceNoSitePreferenceRedirectAbsoluteUrlFTP() throws Exception { this.viewName = "redirect:ftp://spring.io"; replayMocks("redirect:ftp://spring.io"); }
@Test public void resolveViewNameMobileDeviceTabletSitePreferenceTabletPrefixAndSuffix() throws Exception { device.setDeviceType(DeviceType.MOBILE); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); request.setAttribute(SitePreferenceHandler.CURRENT_SITE_PREFERENCE_ATTRIBUTE, SitePreference.TABLET); viewResolver.setTabletPrefix("tablet/"); viewResolver.setTabletSuffix(".tab"); replayMocks("tablet/" + viewName + ".tab"); }
@Test public void resolveViewNameComplexPath() throws Exception { viewResolver.setNormalPrefix("/vi/e/w/s/"); replayMocks("/vi/e/w/s/" + viewName); }
@Test public void resolveViewNameTabletDeviceTabletPrefixForwardToEmpty() throws Exception { this.viewName = "forward:"; device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setTabletPrefix("tablet/"); replayMocks("forward:"); }
@Test public void resolveViewNameMobileDeviceMobilePrefixForwardToRoot() throws Exception { this.viewName = "forward:/"; device.setDeviceType(DeviceType.MOBILE); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setMobilePrefix("mobile/"); replayMocks("forward:/"); }
@Test public void resolveViewNameNormalDeviceNoSitePreferenceNormalSuffix() throws Exception { device.setDeviceType(DeviceType.NORMAL); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setNormalSuffix(".norm"); replayMocks(viewName + ".norm"); }
@Test public void resolveViewNameTabletDeviceTabletSitePreferenceTabletSuffix() throws Exception { device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); request.setAttribute(SitePreferenceHandler.CURRENT_SITE_PREFERENCE_ATTRIBUTE, SitePreference.TABLET); viewResolver.setTabletSuffix(".tab"); replayMocks(viewName + ".tab"); }
@Test public void resolveViewNameNoDeviceNoSitePreferenceRedirect() throws Exception { this.viewName = "redirect:about"; replayMocks("redirect:about"); }
@Test public void resolveViewNameNormalDeviceNormalPrefixForward() throws Exception { this.viewName = "forward:about"; device.setDeviceType(DeviceType.NORMAL); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); viewResolver.setNormalPrefix("normal/"); replayMocks("forward:about"); }
@Test public void resolveViewNameTabletDeviceTabletSitePreferenceTabletPrefix() throws Exception { device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); request.setAttribute(SitePreferenceHandler.CURRENT_SITE_PREFERENCE_ATTRIBUTE, SitePreference.TABLET); viewResolver.setTabletPrefix("tablet/"); replayMocks("tablet/" + viewName); }
@Test public void resolveViewNameNormalDeviceNormalSitePreferenceNormalPrefix() throws Exception { device.setDeviceType(DeviceType.NORMAL); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); request.setAttribute(SitePreferenceHandler.CURRENT_SITE_PREFERENCE_ATTRIBUTE, SitePreference.NORMAL); viewResolver.setNormalPrefix("normal/"); replayMocks("normal/" + viewName); }
@Test public void resolveViewNameTabletDeviceNormalSitePreferenceNormalPrefix() throws Exception { device.setDeviceType(DeviceType.TABLET); request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, device); request.setAttribute(SitePreferenceHandler.CURRENT_SITE_PREFERENCE_ATTRIBUTE, SitePreference.NORMAL); viewResolver.setNormalPrefix("normal/"); replayMocks("normal/" + viewName); }