You can test a private constructor by using Reflection. Insert the following code in your unit test class:
How to test a private constructor
H
You can test a private constructor by using Reflection. Insert the following code in your unit test class:
When you test a DAO class. It is possible you insert or update test data in your database. Of course, we don’t want that. There is a possibility to rollback the transaction when your test is completed.
We use EasyMock to do so.
To count a specific char from a String, you can simply use the Spring framework.
It is possible to test getters and setters (properties) from your model class. Through a test class, it is done in no time.
The equals and hashcode methodes are simple to test with JQNO.
To test your web service, you can use Smock. Smock compares your request with the response by XML files. You just need a response.xml file with your response and a request.xml file with your request.