售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Mockito for Spring
Table of Contents
Mockito for Spring
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
Errata
Piracy
Questions
1. Getting Familiar with the Spring Framework
Getting started with Spring
Exploring the Spring architecture
The core container
The AOP module
The instrumentation module
The messaging module
The data access module
The web layer
The test module
Learning the Inversion of Control
Printing Hello World
Examining life cycle messages
Working with autowiring and annotations
Working with aspects
Exploring Spring JDBC
Handling a transaction with Spring
Working with declarative Spring transaction
Exploring transaction attributes
Using the @Transactional annotation
Working with a programmatic Spring transaction
Using TransactionTemplate
Using PlatformTransactionManager
Building an MVC application with Spring
Summary
2. Working with JUnit and Mockito
Learning unit testing
Working with the JUnit framework
Configuring Eclipse
Examining annotations
Verifying an expectation with an assertion
Examining exception handling
Working with the @RunWith annotation
Working with test suites
Working with assertThat
Exploring equalTo, is, and not
Exploring compound matchers – either, both, anyOf, and allOf
Exploring collection matchers – hasItem and hasItems
Working with string matchers – startsWith, endsWith, and containsString
Exploring custom matchers
Working with Mockito
Learning the significance of Mockito
Exploring Mockito
Configuring Mockito
Mocking in action
Mocking objects
Stubbing methods
Verifying in depth
Verifying zero and no more interactions
Throwing exceptions
Summary
3. Working with Spring Tests
Exploring the TestContext framework
Writing a custom TestExecutionListener interface
Configuring Spring profiles
Mocking an environment
Mocking the JNDI lookup
Using ReflectionTestUtils
Working with annotations
Testing Spring MVC
Mocking the servlet container with MockMvc
Handling transactions in Spring tests
Summary
4. Resolving Out-of-container Dependencies with Mockito
Unit testing the web layer
Unit testing the service layer
Unit testing the data access layer
Summary
5. Time Travelling with Spring
Discovering the new Spring release
Working with asynchronous tasks
Exploring @RestController
Learning AsyncRestTemplate
Caching objects
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜