Examples of RequestMatcher


Examples of com.github.dreamhead.moco.RequestMatcher

        return !matcher.match(request);
    }

    @Override
    public RequestMatcher apply(final MocoConfig config) {
        RequestMatcher appliedMatcher = matcher.apply(config);
        if (appliedMatcher == this.matcher) {
            return this;
        }

        return new NotRequestMatcher(appliedMatcher);
View Full Code Here

Examples of com.github.restdriver.clientdriver.RequestMatcher

        when(mockHttpResponse.getOutputStream()).thenReturn(mockServletOutputStream);
    }
   
    @Test
    public void unexpected_request_error_should_include_expectations() throws IOException, ServletException {
        RequestMatcher requestMatcher = mock(RequestMatcher.class);
        when(requestMatcher.isMatch((RealRequest) anyObject(), (ClientDriverRequest) anyObject())).thenReturn(false);
       
        DefaultClientDriverJettyHandler sut = new DefaultClientDriverJettyHandler(requestMatcher);
        sut.addExpectation(new ClientDriverRequest("/not_matched").withMethod(Method.POST), realResponse);
       
        try {
View Full Code Here

Examples of com.github.restdriver.clientdriver.RequestMatcher

        }
    }
   
    @Test
    public void unexpected_request_should_not_fail_fast_if_excluded() throws IOException, ServletException {
        RequestMatcher requestMatcher = mock(RequestMatcher.class);
        when(requestMatcher.isMatch((RealRequest) anyObject(), (ClientDriverRequest) anyObject())).thenReturn(false);
       
        DefaultClientDriverJettyHandler sut = new DefaultClientDriverJettyHandler(requestMatcher);
        sut.addExpectation(new ClientDriverRequest("/not_matched").withMethod(Method.POST), realResponse);
        sut.noFailFastOnUnexpectedRequest();
        sut.handle("", mockRequest, mockHttpRequest, mockHttpResponse);
View Full Code Here

Examples of org.beangle.web.filter.RequestMatcher

   *            the request URL
   * @return an ordered array of Filters defining the filter chain
   */
  public List<Filter> getFilters(HttpServletRequest request) {
    for (Map.Entry<RequestMatcher, List<Filter>> entry : filterChainMap.entrySet()) {
      RequestMatcher matcher = entry.getKey();
      boolean matched = matcher.matches(request);
      if (matched) { return entry.getValue(); }
    }
    return null;
  }
View Full Code Here

Examples of org.beangle.web.filter.RequestMatcher

   *            the request URL
   * @return an ordered array of Filters defining the filter chain
   */
  public List<Filter> getFilters(HttpServletRequest request) {
    for (Map.Entry<RequestMatcher, List<Filter>> entry : filterChainMap.entrySet()) {
      RequestMatcher matcher = entry.getKey();
      boolean matched = matcher.matches(request);
      if (matched) { return entry.getValue(); }
    }
    return null;
  }
View Full Code Here

Examples of org.beangle.web.filter.RequestMatcher

   *            the request URL
   * @return an ordered array of Filters defining the filter chain
   */
  public List<Filter> getFilters(HttpServletRequest request) {
    for (Map.Entry<RequestMatcher, List<Filter>> entry : filterChainMap.entrySet()) {
      RequestMatcher matcher = entry.getKey();
      boolean matched = matcher.matches(request);
      if (matched) { return entry.getValue(); }
    }
    return null;
  }
View Full Code Here

Examples of org.springframework.security.web.util.RequestMatcher

     */
    public synchronized void addMapping(final String pattern, final RequestMatcher matcher, final String access, final int position) {
        _baseSource = null;
        final Collection<ConfigAttribute> attributes = createAttributes(matcher, access);

        RequestMatcher requestMatcher = findMatchingRequestMatcher(pattern);
        if(requestMatcher == null) {
            requestMatcher = matcher;
        }
        Collection<ConfigAttribute> allAttributes = _requestMap.get(requestMatcher);
        if (allAttributes == null) {
View Full Code Here

Examples of org.springframework.security.web.util.RequestMatcher

     * @param access the new access permissions
     * @throws IllegalArgumentException thrown in pattern does not find a match
     */
    public synchronized void setMapping(String pattern, final String access) throws IllegalArgumentException {
        _baseSource = null;
        RequestMatcher oldMatcher = findMatchingRequestMatcher(pattern);
        for (Map.Entry<RequestMatcher, Collection<ConfigAttribute>> entry : _requestMap.entrySet()) {
            if(entry.getKey() == oldMatcher) {
                entry.setValue(createAttributes(oldMatcher, access));
                break;
            }
View Full Code Here

Examples of org.springframework.security.web.util.RequestMatcher

        return ms.getAllConfigAttributes();
    }

    public synchronized RequestMatcher removeMapping(String pattern) {
        _baseSource = null;
        RequestMatcher toRemove = findMatchingRequestMatcher(pattern);
        if(toRemove == null) {
            throw new IllegalArgumentException(pattern+" has not been found.");
        } else {
            _requestMap.remove(toRemove);
        }
View Full Code Here

Examples of org.springframework.security.web.util.RequestMatcher

    @Override
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Map<String, String> urlPatternDispatchMap = (Map<String, String>) getApplicationContext().getBean("blResourceUrlPatternRequestDispatchMap");
        for (Map.Entry<String, String> entry : urlPatternDispatchMap.entrySet()) {
            RequestMatcher matcher = new AntPathRequestMatcher(entry.getKey());
            if (matcher.matches(request)){
                request.getRequestDispatcher(entry.getValue()).forward(request, response);
                return;
            }
        }
        super.handleRequest(request, response);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.