Package br.com.caelum.vraptor.resource

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


    assertThat(route, canHandle(EndSlashAnnotatedController.class, "withEmptyPath"));

  }
  public void addsAPrefixToMethodsWhenTheControllerEndsWithSlashAndTheMethodAreNotAnnotated() throws Exception {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(EndSlashAnnotatedController.class));
    Route route = getRouteMatching(routes, "/endSlash/withoutPath");

    assertThat(route, canHandle(EndSlashAnnotatedController.class, "withoutPath"));

  }
View Full Code Here


    assertThat(route, canHandle(EndSlashAnnotatedController.class, "withoutPath"));

  }
  @Test
  public void addsAPrefixToMethodsWhenTheControllerAndTheMethodAreAnnotatedWithAbsolutePath() throws Exception {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(PathAnnotatedController.class));
    Route route = getRouteMatching(routes, "/prefix/absolutePath");

    assertThat(route, canHandle(PathAnnotatedController.class, "withAbsolutePath"));

View Full Code Here


  }
  @Test
  public void addsAPrefixToMethodsWhenTheControllerAndTheMethodAreAnnotatedWithEmptyPath() throws Exception {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(PathAnnotatedController.class));
    Route route = getRouteMatching(routes, "/prefix");

    assertThat(route, canHandle(PathAnnotatedController.class, "withEmptyPath"));

View Full Code Here


  }
  @Test
  public void addsAPrefixToMethodsWhenTheControllerIsAnnotatedWithPath() throws Exception {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(PathAnnotatedController.class));
    Route route = getRouteMatching(routes, "/prefix/withoutPath");

    assertThat(route, canHandle(PathAnnotatedController.class, "withoutPath"));

  }
View Full Code Here

    assertThat(route, canHandle(PathAnnotatedController.class, "withoutPath"));

  }
  @Test
  public void findsTheCorrectAnnotatedMethodIfThereIsNoWebMethodAnnotationPresent() throws Exception {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(ClientsController.class));
    Route route = getRouteMatching(routes, "/clients");

    assertThat(route, canHandle(ClientsController.class, "list"));

View Full Code Here


  @Test
  public void suportsTheDefaultNameForANonAnnotatedMethod() throws SecurityException,
    NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(ClientsController.class));
    Route route = getRouteMatching(routes, "/clients/add");

    assertThat(route, canHandle(ClientsController.class, "add"));

View Full Code Here

  }

  @Test
  public void ignoresTheControllerSuffixForANonAnnotatedMethod() throws SecurityException,
    NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(ClientsController.class));
    Route route = getRouteMatching(routes, "/clients/add");

    assertThat(route, canHandle(ClientsController.class, "add"));

View Full Code Here


  }
  @Test
  public void addsASlashWhenUserForgotIt() throws SecurityException,  NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(ClientsController.class));
    Route route = getRouteMatching(routes, "/noSlash");

    assertThat(route, canHandle(ClientsController.class, "noSlash"));

View Full Code Here

  }

  @Test
  public void matchesWhenUsingAWildcard() throws SecurityException, NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(ClientsController.class));
    Route route = getRouteMatching(routes, "/move/second/child");

    assertThat(route, canHandle(ClientsController.class, "move"));

  }
View Full Code Here

  }

  @Test
  public void dontRegisterRouteIfMethodIsNotPublic() {
    List<Route> routes = parser.rulesFor(new DefaultResourceClass(ClientsController.class));
    Route route = getRouteMatching(routes, "/protectMe");
    assertNull(route);

  }
View Full Code Here

TOP

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

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.