Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section B.3. Integration testing with Spring

B.3. Integration testing with Spring

Unit-testing the individual pieces of an application is a good start toward verifying the correctness of software. But it’s just the beginning. Throughout this book, you’ve seen how to use dependency injection and Spring to tie objects together to build applications. Once you know that each of these objects is working, it’s time to test the aggregation of those objects to be sure that they work together. After unit testing, the next phase of testing is integration testing—testing several units of an application in combination.

To find an opportunity for integration testing, look no further than the RoadRantz application. RantsForVehicleController depends on a RantService to do its work. In RantsForVehicleControllerTest, a mock RantService object was injected into the controller in the test’s setUp() method. But when performing integration tests, it is desirable to wire up application objects just like they’ll be wired up in production (or as close as is possible).


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint