Mockito - Most popular Mocking framework for unit tests written in Java

  •        279

Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. Mockito doesn’t give you hangover because the tests are very readable and they produce clean verification errors.

https://site.mockito.org/
https://github.com/mockito/mockito

Tags
Implementation
License
Platform

   




Related Projects

karate - Test Automation Made Simple

  •    Java

Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. The BDD syntax popularized by Cucumber is language-neutral, and easy for even non-programmers. Assertions and HTML reports are built-in, and you can run tests in parallel for speed.

mockery - Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework

  •    PHP

Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending. Mockery is released under a New BSD License.

Cuckoo - Boilerplate-free mocking framework for Swift!

  •    Swift

Cuckoo was created due to lack of a proper Swift mocking framework. We built the DSL to be very similar to Mockito, so anyone using it in Java/Android can immediately pick it up and use it. Cuckoo has two parts. One is the runtime and the other one is an OS X command-line tool simply called CuckooGenerator.

Mock Service Worker - Seamless REST/GraphQL API mocking library for browser and Node

  •    Javascript

Mock by intercepting requests on the network level. Seamlessly reuse the same mock definition for testing, development, and debugging. Browser usage is what sets Mock Service Worker apart from other tools. Utilizing the Service Worker API that intercepts requests for the purpose of caching, Mock Service Worker responds to captured requests with your mock definition on the network level. This way your application knows nothing about the mocking.


testdouble.js - A minimal test double library for TDD with JavaScript

  •    Javascript

Welcome! Are you writing JavaScript tests and in the market for a mocking library to fake out real things for you? testdouble.js is an opinionated, carefully-designed test double library maintained by, oddly enough, a software agency that's also named Test Double. If you practice test-driven development, testdouble.js was designed to promote terse, clear, and easy-to-understand tests. There's an awful lot to cover, so please take some time and enjoy our documentation, which is designed to show you how to make the most out of test doubles in your tests.

mountebank - Over the wire test doubles

  •    HTML

In fact, halfway through we discovered our corporate mocking software couldn’t handle the sheer amount of performance testing we were running as part of this effort (we completely crushed some pretty industrial enterprise software in the process). As a result, we made the call to move the entire program over to a Mountebank OSS-based solution with a custom provision to give us the ability to expand/shrink our mocking needs on demand. mountebank is the first open source tool to provide cross-platform, multi-protocol test doubles over the wire. Just point your application to mountebank instead of the real dependency, and test like you would with traditional stubs and mocks.

mock-socket - Javascript mocking library for websockets and socket.io

  •    Javascript

To use within a node environment you can simply import or require the files directly. This option is great for phantomjs or CI environments. This project uses mocha as its test framework. Tests are located in /test and have 1 of 3 file name prefixes (functional-, issue-#, or unit-).

shellspec - A full-featured BDD unit testing framework for bash, ksh, zsh, dash and all POSIX shells

  •    Shell

ShellSpec is a full-featured BDD unit testing framework for dash, bash, ksh, zsh and all POSIX shells that provides first-class features such as code coverage, mocking, parameterized test, parallel execution and more. It was developed as a dev/test tool for cross-platform shell scripts and shell script libraries. ShellSpec is a new modern testing framework released in 2019, but it's already stable enough. With lots of practical CLI features and simple yet powerful syntax, it provides you with a fun shell script test environment. Version 0.28.0 has a lot of enhancements in the CLI. It is basically compatible, but there are some changes that you need to be aware of. See Migration Guide to Version 0.28.0 for details.

testza - Full-featured test framework for Go! Assertions, mocking, input testing, output capturing, and much more! 🍕

  •    Go

Testza is a full-featured testing framework for Go. It integrates with the default test runner, so you can use it with the standard go test tool. Testza contains easy to use methods, like assertions, output capturing, mocking, and much more. The main goal of testza is to provide an easy and fun experience writing tests and providing a nice, user-friendly output. Even developers who never used testza, will get into it quickly.

mockbin - Mock, Test & Track HTTP Requests and Responses.

  •    Javascript

Mockbin is used internally and maintained by Mashape, who also maintain the open-source API Gateway Kong. read more on Installation.

karate - Test Automation Made Simple

  •    Java

Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. The BDD syntax popularized by Cucumber is language-neutral, and easy for even non-programmers. Powerful JSON & XML assertions are built-in, and you can run tests in parallel for speed.

mockolo - Efficient Mock Generator for Swift

  •    Swift

Mockolo is an efficient mock generator for Swift. Swift doesn't provide mocking support, and Mockolo provides a fast and easy way to autogenerate mock objects that can be tested in your code. One of the main objectives of Mockolo is fast performance. Unlike other frameworks, Mockolo provides highly performant and scalable generation of mocks via a lightweight commandline tool, so it can run as part of a linter or a build if one chooses to do so. Try Mockolo and enhance your project's test coverage in an effective, performant way. One of the main objectives of this project is high performance. There aren't many 3rd party tools that perform fast on a large codebase containing, for example, over 2M LoC or over 10K protocols. They take several hours and even with caching enabled take several minutes. Mockolo was built to make highly performant generation of mocks possible (in the magnitude of seconds) on such large codebase. It uses a minimal set of frameworks necessary (mentioned in the Used libraries section) to keep the code lean and efficient.

OCMockito - Mockito for Objective-C: creation, verification and stubbing of mock objects

  •    Objective-C

OCMockito is an iOS and Mac OS X implementation of Mockito, supporting creation, verification and stubbing of mock objects. Mock objects are always "nice," recording their calls instead of throwing exceptions about unspecified invocations. This makes tests less fragile.

Mocking BizTalk

  •    

Mocking BizTalk is a set of tools aimed at bringing Mock Object concepts in BizTalk solution testing. Actually it consists in a set of MockPipelines whose implementation is not fixed but decided at run-time compiling script files written in boo language.

mocha - Mocha is a mocking and stubbing library for Ruby

  •    Ruby

Install the latest version of the gem with the following command... Note: If you are intending to use Mocha with Test::Unit or MiniTest, you should only setup Mocha after loading the relevant test library...

dockertest - Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work

  •    Go

When developing applications, it is often necessary to use services that talk to a database system. Unit Testing these services can be cumbersome because mocking database/DBAL is strenuous. Making slight changes to the schema implies rewriting at least some, if not all of the mocks. The same goes for API changes in the DBAL. To avoid this, it is smarter to test these specific services against a real database that is destroyed after testing. Docker is the perfect system for running unit tests as you can spin up containers in a few seconds and kill them when the test completes. The Dockertest library provides easy to use commands for spinning up Docker containers and using them for your tests.Using Dockertest is straightforward and simple. Check the releases tab for available releases.

Testify - A toolkit with common assertions and mocks that plays nicely with the standard library

  •    Go

Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend. It supports Easy assertions, Mocking, Testing suite interfaces and functions.

NSubstitute - A friendly substitute for .NET mocking libraries.

  •    CSharp

Visit the NSubstitute website for more information. NSubstitute is designed as a friendly substitute for .NET mocking libraries.






We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.