Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam 2V0-72.22 All Questions

View all questions & answers for the 2V0-72.22 exam

Exam 2V0-72.22 topic 1 question 42 discussion

Actual exam question from VMware's 2V0-72.22
Question #: 42
Topic #: 1
[All 2V0-72.22 Questions]

Which two statements are true regarding @DataJpaTest? (Choose two.)

  • A. TestEntityManager provides all methods that are provided by EntityManager and more.
  • B. If an embedded database is on the classpath, it will be used to configure a DataSource by default.
  • C. It can be used for testing both JPA components and NoSQL components.
  • D. It auto-configures a TestEntityManager bean.
  • E. It can be used for testing JdbcTemplate.
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
2211094
5 months, 1 week ago
A is correct as well as D, why A? here is the reason, TestEntityManager extends EntityManager which means it inherits all methods of EntityManager and adds more specialized methods specifically for testing purposes.
upvoted 1 times
...
Tolo01
1 year, 3 months ago
Selected Answer: BD
A is incorrect because TestEntityManager does not provide all methods that are provided by EntityManager. It only provides a subset of the methods that are relevant for testing. C is incorrect because @DataJpaTest is specifically designed for testing JPA components. It cannot be used for testing NoSQL components. E is incorrect because @DataJpaTest cannot be used for testing JdbcTemplate. JdbcTemplate is a different type of data access abstraction that is not related to JPA.
upvoted 3 times
...
rhuanca
1 year, 8 months ago
why not A instead of B , because @DataJpaTest does not configure any DataSource by default. A and D
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...