Package samples.suppressmethod

Examples of samples.suppressmethod.SuppressMethod


  @Test
  public void delegatingMethodProxyWorksForMethodNames() throws Exception {
    replace(method(SuppressMethod.class, "getObject")).with(new DelegatingInvocationHandler());

    assertSame(SuppressMethod.OBJECT, new SuppressMethod().getObject());
  }
View Full Code Here


  }

  @Test
  public void mockingAndMethodProxyAtTheSameTimeWorks() throws Exception {
    replace(method(SuppressMethod.class, "getObjectStatic")).with(new DelegatingInvocationHandler());
    SuppressMethod tested = mock(SuppressMethod.class);

    when(tested.getObject()).thenReturn("Hello world");

    assertSame(SuppressMethod.OBJECT, SuppressMethod.getObjectStatic());

    assertEquals("Hello world", tested.getObject());

    verify(tested).getObject();
  }
View Full Code Here

  @Test
  @Ignore("Doesn't work atm")
  public void replaceInstanceMethodsWork() throws Exception {
    replace(method(SuppressMethod.class, "getObject")).with(method(SuppressMethodExample.class, "getStringObject"));
    SuppressMethod tested = new SuppressMethod();
    assertEquals("test", tested.getObject());
  }
View Full Code Here

TOP

Related Classes of samples.suppressmethod.SuppressMethod

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.