Search in sources :

Example 1 with ReturnStub

use of org.jmock.core.stub.ReturnStub in project intellij-plugins by JetBrains.

the class JabberTransport_ConnectionTest method createJabberUIMock.

private Mock createJabberUIMock() {
    Mock mockUI = mock(JabberUI.class);
    mockUI.stubs().method("connectAndLogin").will(new ReturnStub(Boolean.TRUE) {

        @Override
        public Object invoke(Invocation invocation) throws Throwable {
            myFacade.connect();
            return super.invoke(invocation);
        }
    });
    return mockUI;
}
Also used : Invocation(org.jmock.core.Invocation) ReturnStub(org.jmock.core.stub.ReturnStub) Mock(org.jmock.Mock)

Aggregations

Mock (org.jmock.Mock)1 Invocation (org.jmock.core.Invocation)1 ReturnStub (org.jmock.core.stub.ReturnStub)1