public abstract class CustomStub extends java.lang.Object implements Stub
final String name = "NAME"; final StringBuffer buffer = new StringBuffer(); mock.expect("describeTo", C.args(C.same(buffer))), new CustomStub("appends name to buffer") { public Object invoke( Invocation invocation ) throws Throwable { return buffer.append(name); } } );
Constructor and Description |
---|
CustomStub(java.lang.String description) |
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuffer |
describeTo(java.lang.StringBuffer buffer)
Appends the description of this object to the buffer.
|
public java.lang.StringBuffer describeTo(java.lang.StringBuffer buffer)
SelfDescribing
describeTo
in interface SelfDescribing
buffer
- The buffer that the description is appended to.