Examples of HandyReturnValues


Examples of org.mockito.internal.progress.HandyReturnValues

    public Object handle(Invocation invocation) throws Throwable {
        Object result = delegate.handle(invocation);
        Class<?> returnType = invocation.getMethod().getReturnType();
        if(result == null && returnType.isPrimitive()) {
            //primitive values cannot be null
            return new HandyReturnValues().returnFor(returnType);
        } else {
            return result;
        }
    }
View Full Code Here

Examples of org.mockito.internal.progress.HandyReturnValues

        //then
        assertEquals(expected, returned);
    }

    private HandyReturnValues will_return(final Object expected) {
        return new HandyReturnValues() {
            @Override
            public <T> T returnFor(Class<T> clazz) {
                return (T) expected;
            }
        };
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.