- Mockito Essentials
- Sujoy Acharya
- 312字
- 2021-08-05 17:41:20
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.
- 編寫(xiě)高質(zhì)量代碼:改善C程序代碼的125個(gè)建議
- C語(yǔ)言程序設(shè)計(jì)實(shí)踐教程
- Mastering Unity Shaders and Effects
- Monitoring Elasticsearch
- Nexus規(guī)模化Scrum框架
- ASP.NET程序設(shè)計(jì)教程
- BeagleBone Black Cookbook
- Hands-On Full Stack Development with Spring Boot 2.0 and React
- Kotlin極簡(jiǎn)教程
- 硬件產(chǎn)品設(shè)計(jì)與開(kāi)發(fā):從原型到交付
- 高效使用Greenplum:入門(mén)、進(jìn)階與數(shù)據(jù)中臺(tái)
- JavaScript前端開(kāi)發(fā)基礎(chǔ)教程
- Spring Boot從入門(mén)到實(shí)戰(zhàn)
- SCRATCH編程課:我的游戲我做主
- Beginning PHP