Monday, July 15, 2013

Mockito

Mockito is a unit test frame work helps in creating mocks and spies in simple way.

For more details on Mocks and Spies, Please refer below introduction

Introduction To Unit Testing
  • Dummy - an empty object passed in an invocation (usually only to satisfy a compiler when a method ar- gument is required)
  • Fake - an object having a functional implementation, but usually in a simplified form, just to satisfy the test (e.g., an in-memory database)
  • Stub - an object with hardcoded behavior suitable for a given test (or a group of tests)
  • Mock - an object with the ability to
             a) have a programmed expected behavior, and

 b) verify the interactions occurring in its lifetime (this object is usually created with the help  of mocking framework)
  • Spy - a mock created as a proxy to an existing real object; some methods can be stubbed, while the un- stubbed ones are forwarded to the covered object
 
 

No comments:

Post a Comment