Book Image

Mockito for Spring

By : Sujoy Acharya
Book Image

Mockito for Spring

By: Sujoy Acharya

Overview of this book

Table of Contents (12 chapters)
Mockito for Spring
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Resolving Out-of-container Dependencies with Mockito

The preceding chapter covered the container Spring integration testing and the Spring testing framework. This chapter deals with the role of the Mockito framework in Spring unit testing and how to resolve container dependency with Mockito. The following topics are covered in depth in this chapter:

  • Unit testing the service layer with Mockito

  • Unit testing the DAO layer with Mockito

  • Unit testing the web layer with Mockito

Enterprise applications change over time. There are several reasons for change, such as the addition of new features, bug fixing, improvement in the non functional requirements such as performance or scalability, regulatory changes such as ICD-10 (ICD-10 is the 10th revision of the International Statistical Classification of Diseases and Related Health Problems (ICD), a medical classification list by the World Health Organization (WHO)), adapting to modern technology such as implementing JPA, and so on. It doesn't...