Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Mock a Java Object in Clojure

I'm exploring clojure.contrib.mock. I think I learned how to mock Clojure functions, but I don't see anything about mocking Java objects.

Is there a Clojure library to help me create Java mock objects or will I have to bring in libraries like EasyMock?

like image 750
Cristian Avatar asked Oct 14 '11 01:10

Cristian


1 Answers

Depending on the Java objects you're trying to mock, you may find proxy and/or reify useful since they let you create Java-compatible objects in Clojure. Can you provide a more concrete example of what you're trying to do?

like image 154
Sean Corfield Avatar answered Oct 08 '22 20:10

Sean Corfield