Esempio n. 1
0
  @Test
  public void shouldMatchAnyMethod() {
    RequestPattern requestPattern = new RequestPattern(ANY, "/any/method");

    for (RequestMethod method : RequestMethod.values()) {
      context = new Mockery();
      Request request = aRequest(context).withUrl("/any/method").withMethod(method).build();
      assertTrue(
          "Method in request pattern is ANY so any method should match",
          requestPattern.isMatchedBy(request));
    }
  }
 @Override
 public RequestMethod getMethod() {
   return RequestMethod.valueOf(request.getMethod().toUpperCase());
 }