paul nisset wrote:
From reading some of the other questions ,I understand that TestNG is meant to be sued as a replacement for JUNit .
paul nisset wrote:
How does Mockito play into it ? Is it meant to be imported to create proxy objects to be used by the unit test ?
I'm not sure if I am using Junit correctly but I usually create a mock/proxy object of the class for each method I'm testing .
Rahul Dayal Sharma wrote:I am interested in learning Mockito and so would like to ask you whether your book requires any pre- requisite knowledge on that subject or in fact any kind of basics whatsoever. Also, like Kathy Sierra and Bert Bates, is your book written in a fun and unorthodox language or is it entirely technical, sticking to the concepts with a good number of examples/ demo to explain the concepts clearly.
What I Expect From You:
In fact there is very little I expect from you, except that you are willing to learn, and ready not just to rethink your current ways of writing code but also to rethink (and maybe even reject!) things you learn from this book. Stay sharp! Question what you know and what you learn! Authors of books are sometimes wrong too!
Apart from having this attitude, you need to know at least the basics of Java (equivalent, let’s say, to a Junior Java Developer).
Meena Ajay wrote:Hi,
In my project Mockito and Junit are used for unit testing. In certain cases, a mix of mock objects and Autowired spring objects are used in combination for the tests.
I have some common resource which is being sourced using Autowired Spring beans and I have a sequence of test methods in the same test class.
The observation is that when the Junit tests on the class are executed from Eclipse directly , they execute properly. But when I run using the maven test command, i find that these tests run in parallel , and each test method is trying to source the same resource (Solace connection) and they fail.
Meena Ajay wrote:On browsing, I found that there is not a straight forward way to execute the test methods in sequence by using some configuration in Junit (specify the order of test methods)
Meena Ajay wrote:Also is there a way to verify that static methods are invoked inside mock objects similar to how one can verify invocation of non-static methods to ensure that these methods are invoked on mock objects
Billy Tsai wrote:How easy is it to introduce either TestNG or Mockito into a very large legacy codebase?
Billy Tsai wrote:are there examples in the book to mix TestNG, Mockito with other frameworks such as JDummy and JMock? how can we utilize TestNG and Mockito with old test frameworks?