Examples of DefaultBeanClass


Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  }

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

    assertThat(route, canHandle(ClientsController.class, "add"));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

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

  @Test
  public void shouldFindSeveralPathsForMethodWithManyValue() throws Exception {
    List<Route> routes = parser.rulesFor(new DefaultBeanClass(ClientsController.class));

    Route route = getRouteMatching(routes, "/path1");
    assertThat(route, canHandle(ClientsController.class, "manyPaths"));
    Route route2 = getRouteMatching(routes, "/path2");
    assertThat(route2, canHandle(ClientsController.class, "manyPaths"));
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    assertThat(route2, canHandle(ClientsController.class, "manyPaths"));
  }

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

    assertThat(route.allowedMethods(), not(contains(HttpMethod.POST)));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    assertThat(route.allowedMethods(), not(contains(HttpMethod.POST)));
  }

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

    assertThat(route.allowedMethods(), is(EnumSet.of(HttpMethod.HEAD)));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    assertThat(route.allowedMethods(), is(EnumSet.of(HttpMethod.HEAD)));
  }

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

    assertThat(route.allowedMethods(), is(EnumSet.of(HttpMethod.OPTIONS)));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    assertThat(route.allowedMethods(), is(EnumSet.of(HttpMethod.OPTIONS)));
  }

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

    assertThat(route.allowedMethods(), is(EnumSet.of(HttpMethod.PATCH)));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    }
  }

  @Test
  public void findsInheritedMethodsWithDefaultNames() throws SecurityException, NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultBeanClass(NiceClients.class));
    Route route = getRouteMatching(routes, "/niceClients/toInherit");

    assertTrue(route.canHandle(NiceClients.class, ClientsController.class.getDeclaredMethod("toInherit")));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    assertTrue(route.canHandle(NiceClients.class, ClientsController.class.getDeclaredMethod("toInherit")));
  }
  @Test
  public void supportMethodOverriding() throws SecurityException, NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultBeanClass(NiceClients.class));
    Route route = getRouteMatching(routes, "/niceClients/add");

    assertThat(route, canHandle(NiceClients.class, "add"));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

  static class UPPERController {
    public void method() {}
  }

  public void shouldlowerFirstWord() {
    List<Route> routes = parser.rulesFor(new DefaultBeanClass(UPPERController.class));
    Route route = getRouteMatching(routes, "/upper/method");

    assertThat(route, canHandle(UPPERController.class, "method"));
  }
View Full Code Here

Examples of br.com.caelum.vraptor.controller.DefaultBeanClass

    public void overridden() {}
  }

  @Test
  public void supportTypeHttpMethodAnnotation() throws SecurityException, NoSuchMethodException {
    List<Route> routes = parser.rulesFor(new DefaultBeanClass(AnnotatedController.class));
    Route route = getRouteMatching(routes, "/annotated/test");
    assertThat(route.allowedMethods(), is(EnumSet.of(HttpMethod.POST)));
  }
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.