skip to content
Mockito Cookbook. Preview this item
ClosePreview this item
Checking...

Mockito Cookbook.

Author: Marcin Grzejszczak
Publisher: Packt Publishing, 2014.
Edition/Format:   eBook : Document : EnglishView all editions and formats
Summary:
This is a focused guide with lots of practical recipes with presentations of business issues and presentation of the whole test of the system. This book shows the use of Mockito's popular unit testing frameworks such as JUnit, PowerMock, TestNG, and so on. If you are a software developer with no testing experience (especially with Mockito) and you want to start using Mockito in the most efficient way then this book  Read more...
Rating:

(not yet rated) 0 with reviews - Be the first.

Subjects
More like this

Find a copy online

Links to this item

Find a copy in the library

&AllPage.SpinnerRetrieving; Finding libraries that hold this item...

Details

Genre/Form: Electronic books
Additional Physical Format: Print version:
Material Type: Document, Internet resource
Document Type: Internet Resource, Computer File
All Authors / Contributors: Marcin Grzejszczak
ISBN: 1306898706 9781306898706 9781783982752 1783982756 1783982748 9781783982745
OCLC Number: 882611110
Language Note: English.
Description: 1 online resource
Contents: Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started with Mockito; Introduction; Adding Mockito to a project's classpath; Getting started with Mockito for JUnit; Getting started with Mockito for TestNG; Mockito best practices --
test behavior not implementation; Adding Mockito hints to exception messages (JUnit) (Experimental); Adding additional Mockito warnings to your tests (JUnit) (Experimental); Chapter 2: Creating Mocks; Introduction; Creating mocks in code; Creating mocks with annotations. Creating mocks with a different default answerCreating mocks with different default answers with annotations; Creating mocks with custom configuration; Creating mocks of final classes with PowerMock; Creating mocks of enums with PowerMock; Chapter 3: Creating Spies and Partial Mocks; Introduction; Creating spies in code; Creating spies with custom configuration; Creating spies using annotations; Creating partial mocks; Creating partial mocks of final classes with delegatesTo(); Creating spies of final classes with PowerMock; Chapter 4: Stubbing Behavior of Mocks; Introduction. Using argument matchers for stubbingStubbing methods that return values; Stubbing methods so that they throw exceptions; Stubbing methods so that they return custom answers; Stubbing methods so that they call real methods; Stubbing void methods; Stubbing void methods so that they throw exceptions; Stubbing void methods so that they return custom answers; Stubbing void methods so that they call real methods; Stubbing final methods with PowerMock; Stubbing static methods with PowerMock; Stubbing object instantiation using PowerMock; Chapter 5: Stubbing Behavior of Spies; Introduction. Stubbing methods that return valuesStubbing methods so that they throw exceptions; Stubbing methods so that they return custom answers; Stubbing void methods; Stubbing void methods so that they throw exceptions; Stubbing void methods so that they return custom answers; Stubbing final methods with PowerMock; Chapter 6: Verifying Test Doubles; Introduction; Verifying the method invocation count with times(); Verifying the method invocation count with atLeast(); Verifying the method invocation count with atMost(); Verifying that interactions never happened. Verifying that interactions stopped happeningVerifying the order of interactions; Verifying interactions and ignoring stubbed methods; Verifying the method invocation within time; Chapter 7: Verifying Behavior with Object Matchers; Introduction; Using Hamcrest matchers for assertions; Creating custom Hamcrest matchers; Using Hamcrest matchers for stubbing and verification; Using AssertJ for assertions; Creating custom AssertJ assertions; Capturing and asserting the argument; Chapter 8: Refactoring with Mockito; Introduction; Removing the problems with instance creation.

Abstract:

This is a focused guide with lots of practical recipes with presentations of business issues and presentation of the whole test of the system. This book shows the use of Mockito's popular unit testing frameworks such as JUnit, PowerMock, TestNG, and so on. If you are a software developer 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.

Reviews

User-contributed reviews
Retrieving GoodReads reviews...
Retrieving DOGObooks reviews...

Tags

Be the first.

Similar Items

Confirm this request

You may have already requested this item. Please select Ok if you would like to proceed with this request anyway.

Linked Data


Primary Entity

<http://www.worldcat.org/oclc/882611110> # Mockito Cookbook.
    a schema:MediaObject, schema:Book, schema:CreativeWork ;
    library:oclcnum "882611110" ;
    schema:about <http://dewey.info/class/006/> ;
    schema:about <http://experiment.worldcat.org/entity/work/data/2026697667#Topic/user_interfaces_computer_systems> ; # User interfaces (Computer systems)
    schema:about <http://experiment.worldcat.org/entity/work/data/2026697667#Topic/computer_interfaces> ; # Computer interfaces
    schema:bookFormat schema:EBook ;
    schema:creator <http://experiment.worldcat.org/entity/work/data/2026697667#Person/grzejszczak_marcin> ; # Marcin Grzejszczak
    schema:datePublished "2014" ;
    schema:description "This is a focused guide with lots of practical recipes with presentations of business issues and presentation of the whole test of the system. This book shows the use of Mockito's popular unit testing frameworks such as JUnit, PowerMock, TestNG, and so on. If you are a software developer 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."@en ;
    schema:description "Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: Getting Started with Mockito; Introduction; Adding Mockito to a project's classpath; Getting started with Mockito for JUnit; Getting started with Mockito for TestNG; Mockito best practices -- test behavior not implementation; Adding Mockito hints to exception messages (JUnit) (Experimental); Adding additional Mockito warnings to your tests (JUnit) (Experimental); Chapter 2: Creating Mocks; Introduction; Creating mocks in code; Creating mocks with annotations."@en ;
    schema:exampleOfWork <http://worldcat.org/entity/work/id/2026697667> ;
    schema:genre "Electronic books"@en ;
    schema:inLanguage "en" ;
    schema:isSimilarTo <http://worldcat.org/entity/work/data/2026697667#CreativeWork/> ;
    schema:name "Mockito Cookbook."@en ;
    schema:productID "882611110" ;
    schema:publication <http://www.worldcat.org/title/-/oclc/882611110#PublicationEvent/packt_publishing_2014> ;
    schema:publisher <http://experiment.worldcat.org/entity/work/data/2026697667#Agent/packt_publishing> ; # Packt Publishing
    schema:url <http://www.myilibrary.com?id=621121> ;
    schema:url <http://www.totalboox.com/book/id-1056096306467846072> ;
    schema:url <http://public.eblib.com/choice/publicfullrecord.aspx?p=1719576> ;
    schema:url <http://public.ebookcentral.proquest.com/choice/publicfullrecord.aspx?p=1719576> ;
    schema:url <https://ebookcentral.proquest.com/lib/ben/detail.action?docID=1719576> ;
    schema:url <http://ebookcentral.proquest.com/lib/columbia/detail.action?docID=1719576> ;
    schema:url <https://ebookcentral.proquest.com/lib/ucm/detail.action?docID=1719576> ;
    schema:url <http://cdn.totalboox.com/static/covers/PT/ea801fecb9e37b8-b.jpg> ;
    schema:workExample <http://worldcat.org/isbn/9781783982745> ;
    schema:workExample <http://worldcat.org/isbn/9781306898706> ;
    schema:workExample <http://worldcat.org/isbn/9781783982752> ;
    wdrs:describedby <http://www.worldcat.org/title/-/oclc/882611110> ;
    .


Related Entities

<http://experiment.worldcat.org/entity/work/data/2026697667#Agent/packt_publishing> # Packt Publishing
    a bgn:Agent ;
    schema:name "Packt Publishing" ;
    .

<http://experiment.worldcat.org/entity/work/data/2026697667#Person/grzejszczak_marcin> # Marcin Grzejszczak
    a schema:Person ;
    schema:familyName "Grzejszczak" ;
    schema:givenName "Marcin" ;
    schema:name "Marcin Grzejszczak" ;
    .

<http://experiment.worldcat.org/entity/work/data/2026697667#Topic/computer_interfaces> # Computer interfaces
    a schema:Intangible ;
    schema:name "Computer interfaces"@en ;
    .

<http://experiment.worldcat.org/entity/work/data/2026697667#Topic/user_interfaces_computer_systems> # User interfaces (Computer systems)
    a schema:Intangible ;
    schema:name "User interfaces (Computer systems)"@en ;
    .

<http://worldcat.org/isbn/9781306898706>
    a schema:ProductModel ;
    schema:isbn "1306898706" ;
    schema:isbn "9781306898706" ;
    .

<http://worldcat.org/isbn/9781783982745>
    a schema:ProductModel ;
    schema:isbn "1783982748" ;
    schema:isbn "9781783982745" ;
    .

<http://worldcat.org/isbn/9781783982752>
    a schema:ProductModel ;
    schema:isbn "1783982756" ;
    schema:isbn "9781783982752" ;
    .

<https://ebookcentral.proquest.com/lib/ben/detail.action?docID=1719576>
    rdfs:comment "(access limited to Benedictine University patrons)" ;
    .


Content-negotiable representations

Close Window

Please sign in to WorldCat 

Don't have an account? You can easily create a free account.