Package br.com.caelum.vraptor.resource

Examples of br.com.caelum.vraptor.resource.ResourceMethod


  public void shouldAcceptCaseInsensitiveRequestMethods() {
    when(request.getRequestURI()).thenReturn("/url");
    when(request.getMethod()).thenReturn("pOsT");
    when(router.parse("/url", HttpMethod.POST,webRequest)).thenReturn(method);

  ResourceMethod resource = translator.translate(info);

  assertThat(resource, is(equalTo(method)));
  }
View Full Code Here


    when(request.getRequestURI()).thenReturn("/url");
    when(request.getParameter("_method")).thenReturn("gEt");
    when(request.getMethod()).thenReturn("POST");
    when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method);

  ResourceMethod resource = translator.translate(info);
  assertThat(resource, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/url");
    when(request.getParameter("_method")).thenReturn("DELETE");
    when(request.getMethod()).thenReturn("POST");
    when(router.parse("/url", HttpMethod.DELETE, webRequest)).thenReturn(method);

  ResourceMethod resource = translator.translate(info);
  assertThat(resource, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/url");
    when(request.getContextPath()).thenReturn("");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method);

    ResourceMethod resource = translator.translate(info);
    assertThat(resource, is(equalTo(method)));

  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/custom_context/url");
    when(request.getContextPath()).thenReturn("/custom_context");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/url", HttpMethod.GET, webRequest)).thenReturn(method);

    ResourceMethod resource = translator.translate(info);
    assertThat(resource, is(equalTo(method)));
  }
View Full Code Here

  public void canHandleUrlIfPlainRootContext() {
    when(request.getRequestURI()).thenReturn("/");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/", HttpMethod.GET, webRequest)).thenReturn(method);

    ResourceMethod resource = translator.translate(info);
    assertThat(resource, is(equalTo(method)));
     }
View Full Code Here

  public void canHandleComposedUrlIfPlainRootContext() {
    when(request.getRequestURI()).thenReturn("/products/1");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/products/1", HttpMethod.GET, webRequest)).thenReturn(method);

    ResourceMethod resource = translator.translate(info);
    assertThat(resource, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/custom_context/products/1");
    when(request.getContextPath()).thenReturn("/custom_context");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/products/1", HttpMethod.GET, webRequest)).thenReturn(method);

    ResourceMethod resource = translator.translate(info);
    assertThat(resource, is(equalTo(method)));
  }
View Full Code Here

    when(request.getRequestURI()).thenReturn("/custom_context/");
    when(request.getContextPath()).thenReturn("/custom_context");
    when(request.getMethod()).thenReturn("GET");
    when(router.parse("/", HttpMethod.GET, webRequest)).thenReturn(method);

    ResourceMethod resource = translator.translate(info);
    assertThat(resource, is(equalTo(method)));
  }
View Full Code Here

  }

  @Test
  public void returnsNullWhenInstantiatingAStringForWhichThereAreNoParameters() throws Exception {
    thereAreNoParameters();
    final ResourceMethod method = string;

    Object[] params = provider.getParametersFor(method, errors, null);

    assertArrayEquals(new Object[] {null}, params);
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.resource.ResourceMethod

Copyright © 2018 www.massapicom. 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.