This tutorial focuses on testing data access logic with spring-test and hsqldb. This extends Part #2: JPA Hibernate Spring Maven Eclipse Tutorial – JPA configs and repository Testing the mapping…
…This tutorial focuses on testing data access logic with spring-test and hsqldb. This extends Part #2: JPA Hibernate Spring Maven Eclipse Tutorial – JPA configs and repository Testing the mapping…
Login Register 100+ Free Java interview FAQs 100+ Free Big Data interview FAQs
This post extends the previous one on “Unit Test Hibernate – DAO Layer with Spring & HSQLDB“. The changes are
1. Add “persistence-jpa.xml” to src/main/resources.
2. Modify the “entityManagerFactory()” method in the “SimpleConfig.java”.
1 2 3 4 5 6 7 |
<? |
Step 1: The pom.xml file with test jars, Spring jars, and hibernate jars
Most interviewers like Java candidates those who are passionate and experienced about writing unit tests. Any non trivial Java application will be making calls to database tables. So, here are a few questions and answers testing your ability to write unit tests to test data access layer.
Q1. How will you go about unit testing the data access logic?…