Hello,
Let's say we have an application that connects to the DB and insert few records. If I want to
Unit Test it using
Junit, then we will have to connect to the DB and then insert few records and then verify them ? Is this the correct approach. How does it work, as I want to run my unit test cases multiple times. But if I insert same records every time, there will be a unique constraint violation at DB side. How do we handle it. What is the standard practice.
Another question I have is how to unit test web applications that are deployed on containers like
tomcat. Should the application be deployed on tomcat and running while unit testing its classes.
Regards,
Rakesh.