Book Image

SPRING COOKBOOK

By : Jerome Jaglale, Yilmaz
Book Image

SPRING COOKBOOK

By: Jerome Jaglale, Yilmaz

Overview of this book

This book is for you if you have some experience with Java and web development (not necessarily in Java) and want to become proficient quickly with Spring.
Table of Contents (14 chapters)
13
Index

Introduction


We often skip unit testing because we don't know how to do it or we believe that testing web applications is difficult. In fact, unit testing is easy and Spring makes web application testing effortless.

In this chapter, you will first learn how to write unit tests using JUnit, TestNG, and Mockito. Then, we will use Spring context, dependency injection, and transactions in our tests. Finally, we will test Spring controller methods using only a few lines of code.