官术网_书友最值得收藏!

What this book covers

Chapter 1, Exploring Test Doubles, covers the concept of automated unit tests, talks about the characteristics of a good unit test, and explores the test's doubles. It provides examples of dummy objects, fake objects, stubs, mock objects, and spies.

Chapter 2, Socializing with Mockito, focuses on getting the reader quickly started with the Mockito overview, unit test qualities, and the significance of Mockito in unit testing. It also explains and provides examples of stubbing, answering, throwing exceptions, argument matchers, and method call verification. The Mockito architecture is also uncovered.

Chapter 3, Accelerating Mockito, illustrates advanced Mockito framework topics, such as working with void methods, throwing exceptions from void methods, writing callbacks for void methods, returning values using doReturn, void method chaining, calling original methods, Mockito annotations, verifying arguments using an argument captor, verifying an invocation order, spying objects using spy, changing default Mockito settings, resetting mock objects, inline stubbing, and mock details.

Chapter 4, Behavior-driven Development with Mockito, unfolds the BDD concepts, BDD examples, and writing BDD style tests with Mockito.

Chapter 5, Unit Testing the Legacy Code with Mockito, explores legacy code, testing impediments, design for testability, and unit testing the legacy code with Mockito and PowerMock. By the end of this chapter, the reader will be able to write JUnit tests for a legacy code with Mockito and PowerMock, refactor the legacy code to make it unit testable, and design code to bypass the testing impediments.

Chapter 6, Developing SOA with Mockito, deals with web services, explores SOAP and RESTful web services with examples, and helps us to write JUnit tests for the web services with Mockito to mock out the web service framework dependencies.

Chapter 7, Unit Testing GWT Code with Mockito, provides an overview of Ajax/GWT, explains the MVP pattern and loose coupling, and provides examples and strategies to mock GWT widgets using Mockito.

主站蜘蛛池模板: 阜宁县| 澜沧| 榆中县| 新野县| 广安市| 定结县| 禹州市| 德化县| 固阳县| 曲麻莱县| 西安市| 高安市| 清水河县| 河间市| 社旗县| 旺苍县| 建水县| 林西县| 平和县| 普格县| 墨脱县| 乌兰浩特市| 台东县| 余姚市| 抚州市| 虞城县| 荣成市| 舞阳县| 罗源县| 南汇区| 青铜峡市| 都昌县| 乌鲁木齐市| 安化县| 岳池县| 瑞昌市| 车致| 梅河口市| 青海省| 延川县| 芒康县|