@Test public void testUsePropertiesFromRequest() throws IOException, ServletException { HttpSession session = mock(HttpSession.class); when(request.getSession()).thenReturn(session); when(request.getSession(anyBoolean())).thenReturn(session); Map<String, String[]> requestParams = new HashMap<String, String[]>(); requestParams.put("flip.featureName", new String[]{"enabled"}); when(request.getParameterMap()).thenReturn(requestParams); FeatureDescriptorsMap sessionFeatureMap = new FeatureDescriptorsMap(); when(session.getAttribute(FlipOverrideFilter.SESSION_FEATURES_KEY)).thenReturn(sessionFeatureMap); filter.doFilter(request, response, filterChain); FeatureDescriptor featureDescriptor = sessionFeatureMap.get("featureName"); assertEquals("featureName", featureDescriptor.getName()); assertEquals(FeatureState.ENABLED, featureDescriptor.getState()); }
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { applyFeaturesFromRequestParameters(request); chain.doFilter(request, response); FlipWebContext.clear(); }
FlipOverrideFilter implements Filter { public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { applyFeaturesFromRequestParameters(request); chain.doFilter(request, response); FlipWebContext.clear(); } }
FlipOverrideFilter implements Filter { public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { applyFeaturesFromRequestParameters(request); chain.doFilter(request, response); FlipWebContext.clear(); }  }
FlipOverrideFilter implements Filter { public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { applyFeaturesFromRequestParameters(request); chain.doFilter(request, response); FlipWebContext.clear(); }  void init(final FilterConfig filterConfig); void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain); void destroy(); }
FlipOverrideFilter implements Filter { public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { applyFeaturesFromRequestParameters(request); chain.doFilter(request, response); FlipWebContext.clear(); }  void init(final FilterConfig filterConfig); void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain); void destroy(); static final String SESSION_FEATURES_KEY; }