Testing the Entity Manager API
13th Dec 2021 by Aneesh Mistry
Testing the EntityManager
Use Mockito to create stubbed query responses when testing implementations of the Entity Manager API. The Entity Manager API is used to create instances for persistance that fall on the repository layer of a Spring Boot application. The Entity Manager will manage the lifecycle fo the entity instances for persistance, and can be highly important when persisting and managing data for an application.
This video will use Mockito to stub an EntityManager and Query to control the response of an EntityManager for testing a simple select query.