### Question:
SiteSwitcherRequestFilter extends OncePerRequestFilter { public String getServerName() { return serverName; } SiteSwitcherRequestFilter();  SiteSwitcherRequestFilter(SiteUrlFactory normalSiteUrlFactory, SiteUrlFactory mobileSiteUrlFactory,
			SiteUrlFactory tabletSiteUrlFactory, SitePreferenceHandler sitePreferenceHandler); String getSwitcherMode(); void setSwitcherMode(String switcherMode); String getServerName(); void setServerName(String serverName); Boolean getTabletIsMobile(); void setTabletIsMobile(Boolean tabletIsMobile); String getMobilePath(); void setMobilePath(String mobilePath); String getTabletPath(); void setTabletPath(String tabletPath); String getRootPath(); void setRootPath(String rootPath);  }### Answer:
@Test public void urlPathMobileDeviceNoPreference() throws Exception { device.setDeviceType(DeviceType.MOBILE); SiteSwitcherRequestFilter urlPath = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "urlPath"); filterConfig.addInitParameter("mobilePath", "/mob"); urlPath.init(filterConfig); urlPath.doFilter(request, response, filterChain); assertEquals(0, response.getCookies().length); assertEquals("http: }
@Test public void urlPathRootPathMobileDeviceNoPreference() throws Exception { device.setDeviceType(DeviceType.MOBILE); SiteSwitcherRequestFilter urlPath = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "urlPath"); filterConfig.addInitParameter("mobilePath", "/mob"); filterConfig.addInitParameter("rootPath", "/app"); urlPath.init(filterConfig); urlPath.doFilter(request, response, filterChain); assertEquals(0, response.getCookies().length); assertEquals("http: }
@Test public void urlPathTabletDeviceNoPreference() throws Exception { device.setDeviceType(DeviceType.TABLET); SiteSwitcherRequestFilter urlPath = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "urlPath"); filterConfig.addInitParameter("tabletPath", "/tab"); urlPath.init(filterConfig); urlPath.doFilter(request, response, filterChain); assertEquals(0, response.getCookies().length); assertEquals("http: }
@Test public void urlPathRootPathTabletDeviceNoPreference() throws Exception { device.setDeviceType(DeviceType.TABLET); SiteSwitcherRequestFilter urlPath = new SiteSwitcherRequestFilter(); MockFilterConfig filterConfig = new MockFilterConfig(); filterConfig.addInitParameter("switcherMode", "urlPath"); filterConfig.addInitParameter("tabletPath", "/tab"); filterConfig.addInitParameter("rootPath", "/app"); urlPath.init(filterConfig); urlPath.doFilter(request, response, filterChain); assertEquals(0, response.getCookies().length); assertEquals("http: }