Books: 4

Mockito

CoverTitleYear
Learn all you need to know about the Spring Framework and how to unit test your projects with Mockito
Mockito is a testing framework that creates external dependencies; this process is called mocking. This book will provide you with the skills you need to successfully build and maintain meaningful unit and integration test cases for Spring Framework code. This book starts with a brief introduction to more » the Spring Framework, including its components and architecture. Packed with real-world examples, the book covers how to make Spring code testable and mock container and external dependencies using Mockito. You then get a walkthrough of the steps that will help you in applying Spring 4 Framework features and advanced Spring testing module features in the real world. By the end of the book, you will be a competent software tester with Spring and Mockito. « less
2015
Over 65 recipes to get you up and running with unit testing using Mockito
ABOUT THIS BOOK * Implement best practices to perform tests with Mockito * Extend Mockito with other popular Java-based unit testing frameworks such as JUnit and Powermock * A focused guide with many recipes on testing your software using Mockito WHO THIS BOOK IS FOR If you are a software developer more » with no testing experience (especially with Mockito) and you want to start using Mockito in the most efficient way then this book is for you. This book assumes that you have a good knowledge level and understanding of Java-based unit testing frameworks. WHAT YOU WILL LEARN * Create beautiful tests using Mockito * Create mocks and spies in a number of ways * Implement best practices to perform tests with Mockito * Extend Mockito with other popular Java-based unit testing frameworks such as JUnit and PowerMock * Stub behavior of mocks and spies * Verify test doubles with Mockito * Write good tests using Mockito * Integrate Mockito with DI systems * Compare Mockito to other mocking frameworks * Verify the behavior of your system under test IN DETAIL Mockito is a testing framework that allows you to easily create test doubles (mocks) of the system under test's collaborators. You can use mocks to better simulate the behavioral patterns of your software in isolation to receive feedback from tests as soon as possible. This book consists of recipes that depict the usage of a vast majority of Mockito functionalities in real-life examples. It goes beyond the documentation and covers how Mockito works and shows the steps to write effective tests using Mockito. This is a focused guide with lots of practical recipes of business issues and presentation of the entire test of the system. This book shows the use of Mockito's popular unit testing frameworks such as JUnit, PowerMock, TestNG, and so on. « less
2014
A practical guide to get you up and running with unit testing using Mockito
ABOUT THIS BOOK * Explore Mockito features and learn stubbing, mocking and spying dependencies using the Mockito framework * Mock external dependencies for legacy and greenfield projects and create an automated JUnit safety net for building reliable, maintainable and testable software * A focused more » guide filled with examples and supporting illustrations on testing your software using Mockito WHO THIS BOOK IS FOR 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. WHAT YOU WILL LEARN * Explore test doubles and work with dummy, spy, fake, stub, and mock objects * Uncover the Mockito architecture and build a custom mocking framework * Mock, stub, and spy external code dependencies using Mockito * Practice Behavior-driven Development (BDD) with Mockito * Make legacy code testable by mocking and spying dependencies * Mock GWT and web service dependencies using Mockito * Discover argument captors, inline stubbing, and resetting mock objects IN DETAIL Whether you are new to JUnit testing and mocking or a seasoned Mockito expert, this book will provide you with the skills you need to successfully build and maintain meaningful JUnit test cases and effectively mock external dependencies. At the beginning, this book deals with dummy and fake objects and then moves on to exploring stubs followed by an example on spying. Then, it will show you how to make legacy code testable, mock external dependencies using Mockito, and write testable code for greenfield projects. You will also gain an insight on the concepts of Service-oriented Architecture (SOA) as well as understand how to unit test RESTful web services with Mockito. By sequentially working through the steps in each chapter, you will quickly learn the features of Mockito. Mockito Essentials will ensure your success with these concepts, tools, and frameworks. « less
2014
Learn how to apply Test-Driven Development and the Mockito framework in real life projects, using realistic, hands-on examples
Overview * Start writing clean, high quality code to apply Design Patterns and principles * Add new features to your project by applying Test-first development- JUnit 4.0 and Mockito framework * Make legacy code testable and clean up technical debts In Detail The usual life cycle of code involves more » adding code, breaking an existing functionality, fixing that and breaking a new area! This fragility can be fixed using automated tests and Test Driven Development. TDD’s test first approach expedites the development process and unit tests act as safety nets for code refactoring and help in maintaining and extending the code. This makes TDD highly beneficial for new projects. This practical, hands-on guide provides you with a number of clear, step-by-step exercises that will help you to take advantage of the real power that is behind Test Driven Development and the Mockito framework. By using this book, you will gain the knowledge that you need to use the Mockito framework in your project. This book explains the concept of Test Driven Development (TDD), including mocking and refactoring, as well as breaking down the mystery and confusion that surrounds the test first approach of TDD. It will take you through a number of clear, practical examples that will help you to take advantage of TDD with the Mockito framework, quickly and painlessly. You will learn how to write unit tests, refactor code and remove code smells. We will also take a look at mock objects and learn to use Mockito framework to stub, mock, verify and spy objects for testability. You will also learn to write clean, maintainable, and extensible code using design principles and patterns. If you want to take advantage of using Test Driven Development and learn about mocking frameworks, then this is the book for you. You will learn everything you need to know to apply Test Driven Development in a real life project, as well as how to refactor legacy code and write quality code using design patterns. What you will learn from this book * Create your first unit test and discover the power of unit testing * Familiarize yourself with Test-first Development and the refactoring process * Add new features to your project applying Test Driven Development * Create readable, maintainable, and extensible software using design principles and patterns * Start stubbing, mocking, spying, and verifying objects using Mockito APIs * Apply inside-out and outside-in TDD styles * Expedite the development process using Eclipse and keyboard shortcuts * Apply JUnit 4.0 and advanced Mockito features – argument captor, callbacks, and answers Approach This book is a hands-on guide, full of practical examples to illustrate the concepts of Test Driven Development. Who this book is written for If you are a developer who wants to develop software following Test Driven Development using Mockito and leveraging various Mockito features, this book is ideal for you. You don’t need prior knowledge of TDD, Mockito, or JUnit. It is ideal for developers, who have some experience in Java application development as well as a basic knowledge of unit testing, but it covers the basic fundamentals of TDD and JUnit testing to get you acquainted with these concepts before delving into them. « less
2013