Package br.com.caelum.vraptor.controller

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


    interpolator = new MessageInterpolatorFactory(validatorFactory).getInstance();
    validator = new MockValidator();
    withConstraint = instanceFor(MyController.class, getMethod("withConstraint",String.class));
    withoutConstraint = instanceFor(MyController.class, getMethod("withoutConstraint",String.class));
    withoutConstraintAndDomainObject = instanceFor(MyController.class, getMethod("withoutConstraintAndDomainObject",Example.class));
    instance = new DefaultControllerInstance(new MyController());
  }
View Full Code Here


  @Test
  public void shouldAcceptIfMethodHasConstraint() {
    methodInfo.setControllerMethod(withConstraint);

    DefaultControllerInstance controller = spy(instance);
    getMethodValidator().validate(new MethodReady(withConstraint), controller, methodInfo, validator);
    verify(controller).getController();
  }
View Full Code Here

    verify(controller).getController();
  }

  @Test
  public void shouldNotAcceptIfMethodHasConstraint() {
    DefaultControllerInstance controller = spy(instance);
    getMethodValidator().validate(new MethodReady(withoutConstraint), controller, methodInfo, validator);
    verify(controller, never()).getController();
  }
View Full Code Here

    verify(controller, never()).getController();
  }
 
  @Test
  public void shouldNotAcceptIfMethodDoesNotHaveConstraintAndHasDomainObjectParameter() {
    DefaultControllerInstance controller = spy(instance);
    getMethodValidator().validate(new MethodReady(withoutConstraintAndDomainObject), controller, methodInfo, validator);
    verify(controller, never()).getController();
  }
View Full Code Here

TOP

Related Classes of br.com.caelum.vraptor.controller.DefaultControllerInstance

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.