万本电子书0元读

万本电子书0元读

顶部广告

Mockito Essentials电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Sujoy Acharya

出  版  社:Packt Publishing

出版时间:2014-10-24

字       数:161.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
This book is ideal for developers who have some experience in Java application development as well as some basic knowledge of test doubles and JUnit testing. This book also introduces you to the fundamentals of JUnit testing, test doubles, refactoring legacy code, and writing JUnit tests for GWT and web services.
目录展开

Mockito Essentials

Table of Contents

Mockito Essentials

Credits

About the Author

About the Reviewers

www.PacktPub.com

Support files, eBooks, discount offers, and more

Why subscribe?

Free access for Packt account holders

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. Exploring Test Doubles

Working with unit tests

Understanding test doubles

Using dummy objects

Working with stubs

Exploring a test spy

Getting started with mock objects

Implementing fake objects – simulators

Summary

2. Socializing with Mockito

Exploring Mockito

Exploring unit test qualities

Realizing the significance of Mockito

Working with Mockito

Adding a Mockito dependency

Stubbing method calls

Throwing exceptions

Using argument matchers

Working with wildcard matchers

Working with a custom ArgumentMatcher class

Comparison matchers – equalTo, is, and not

Compound value matchers – either, both, anyOf, allOf, and not

Verifying method calls

Verifying zero and no-more interactions

Answering method calls

Understanding the Mockito architecture

Summary

3. Accelerating Mockito

Learning advanced Mockito features

Working with void methods

Throwing exceptions from void methods

Working with void method callbacks

Learning doCallRealMethod and doNothing

Exploring doReturn

Verifying arguments using ArgumentCaptor

Working with generic collection arguments

Working with variable arguments and arrays

Verifying an invocation order

Spying objects

Exploring Mockito annotations

Changing the default Mockito settings

Resetting mock objects

Working with inline stubbing

Determining mock details

Summary

4. Behavior-driven Development with Mockito

Understanding the context of BDD

Exploring the top-down strategy

Exploring the bottom-up strategy

Finding the gaps

Exploring BDD

Exercising BDD with Mockito

The BDD syntax

Summary

5. Unit Testing the Legacy Code with Mockito

Understanding the legacy code

Exploring testing impediments

Working with PowerMock

Stubbing static methods

Suppressing static blocks

Suppressing a superclass constructor

Suppressing our own constructor

Suppressing methods

Stubbing private methods

Stubbing final methods

Mocking final classes

Designing for testability with Mockito

Identifying constructor issues

Realizing initialization issues

Working with private methods

Working with final methods

Exploring static method issues

Working with final classes

Learning new concerns

Exploring static variables and blocks

Summary

6. Developing SOA with Mockito

Exploring Service-oriented Architecture (SOA)

Working with web services

Exploring JAX-WS with Eclipse

Developing a RESTful web service

Building a RESTful web service with Spring Framework

Summary

7. Unit Testing GWT Code with Mockito

Exploring Ajax and GWT

Learning the MVP pattern

Developing a GWT application using MVP

Unit testing the GWT code

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部