Examples of MethodLevelAcceptsController


Examples of br.com.caelum.vraptor.interceptor.example.MethodLevelAcceptsController

 

  @Test
  public void shouldAcceptMethodWithAnnotation() throws Exception {
    WithAnnotationAcceptor acceptor = new WithAnnotationAcceptor();   
    DefaultControllerInstance controllerInstance = new DefaultControllerInstance(new MethodLevelAcceptsController());
    AnnotationLiteral<NotLogged> notLogged = new AnnotationLiteral<NotLogged>() {};
   
    acceptor.initialize(annotation);
   
    when(controllerMethod.getAnnotations()).thenReturn(new Annotation[]{notLogged});
View Full Code Here

Examples of br.com.caelum.vraptor.interceptor.example.MethodLevelAcceptsController

  }
 
  @Test
  public void shouldNotAcceptMethodWithoutAnnotation() throws Exception {
    WithAnnotationAcceptor acceptor = new WithAnnotationAcceptor();
    DefaultControllerInstance controllerInstance = new DefaultControllerInstance(new MethodLevelAcceptsController());
   
    acceptor.initialize(annotation);
   
    when(controllerMethod.getAnnotations()).thenReturn(new Annotation[]{});
   
View Full Code Here

Examples of br.com.caelum.vraptor.interceptor.example.MethodLevelAcceptsController

        withAnnotationAcceptor);

    when(withAnnotationAcceptor.validate(Mockito.same(controllerMethod),
      Mockito.any(ControllerInstance.class))).thenReturn(true);

    aspectHandler.execute(stack, controllerMethod, new MethodLevelAcceptsController());

    assertTrue(interceptor.isBeforeCalled());
    assertTrue(interceptor.isInterceptCalled());
    assertTrue(interceptor.isAfterCalled());
View Full Code Here

Examples of br.com.caelum.vraptor.interceptor.example.MethodLevelAcceptsController

      InterceptorWithCustomizedAccepts.class, interceptor,withAnnotationAcceptor);

    when(withAnnotationAcceptor.validate(Mockito.same(controllerMethod),
        Mockito.any(ControllerInstance.class))).thenReturn(false);

    aspectHandler.execute(stack, controllerMethod, new MethodLevelAcceptsController());

    assertFalse(interceptor.isBeforeCalled());
    assertFalse(interceptor.isInterceptCalled());
    assertFalse(interceptor.isAfterCalled());
  }
View Full Code Here

Examples of br.com.caelum.vraptor.interceptor.example.MethodLevelAcceptsController

  @Before
  public void setup() {
    MockitoAnnotations.initMocks(this);
    interceptor = new InterceptorWithCustomizedAccepts();
    controllerInstance = new DefaultControllerInstance(new MethodLevelAcceptsController());
    constraints = getCustomAcceptsAnnotations(interceptor.getClass());
    when(withAnnotationAcceptor.validate(controllerMethod, controllerInstance)).thenReturn(true);
  }
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.