Audience
DevOps teams looking for a Unit Testing solution
About MockK
Mocking is a technique to make testing code readable and maintainable. In three consequent articles, I would like to show the basics, features, and quirks of the MockK library. It is a new open-source library (github repository) focused on making mocking in Kotlin great. Injection first tries to match properties by name, then by class or superclass. Check the lookupType parameter for customization. Properties are injected even if private is applied. Constructors for injection are selected from the biggest number of arguments to lowest.
Other Popular Alternatives & Related Software
Telerik JustMock
JustMock allows you to easily isolate your testing scenario and lets you focus on the logic you want to verify. It integrates seamlessly with your favorite unit testing framework and makes unit testing and mocking simple and fast. Mock everything like non-virtual methods, sealed classes, static methods and classes, as well as non-public members and types everywhere even members of MsCorLib. The perfect tool for unit testing your .NET code whether you're dealing with complex and hard to maintain legacy code or code written with best practices in mind. From finding what arguments your mock object is called with to why it’s not called or why it’s called repeatedly, the JustMock Debug Window helps you find the answers you are looking for while debugging your unit tests. JustMock allows you to receive critical feedback about the completeness and thoroughness of your unit tests—an absolute must for any organization that strives for high-quality code.
Learn more
PowerMock
Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to good design, but this is not always the case. For example final classes and methods cannot be used, private methods sometimes need to be protected or unnecessarily moved to a collaborator, static methods should be avoided completely and so on simply because of the limitations of existing frameworks. PowerMock is a framework that extends other mock libraries such as EasyMock with more powerful capabilities. PowerMock uses a custom classloader and bytecode manipulation to enable mocking of static methods, constructors, final classes and methods, private methods, removal of static initializers and more. By using a custom classloader no changes need to be done to the IDE or continuous integration servers which simplifies adoption.
Learn more
Blackbird API Development
Accelerate Development of Prod-Ready APIs.
AI-Powered Code Gen, Mocking in Minutes, and On-Demand Ephemeral Test Environments.
* Design Efficiently: Generate standardized OpenAPI specs with AI assistance, allowing you to begin coding faster.
* Mock Effortlessly: Create shareable API mocks without manual coding, enabling rapid validation.
* Automate Repetitive Tasks: Utilize AI to automatically generate boilerplate code for both client and server-side APIs.
* Test Effectively: Access publicly available URLs for testing in a production-like test environment through Blackbird's ephemeral testing environments.
* Debug Seamlessly: Set breakpoints and debug directly from your preferred IDE with Blackbird's integrated debugging tools.
* Deploy Smoothly: Utilize a 24/7 hosted environment for progressive and repeated testing without reconfiguration, facilitated by Blackbird's containerized deployment.
Learn more
JMockit
The toolkit is provided as a set of artifacts deployed to the Maven Central repository. It requires Java 7 or newer for test execution; tests must use JUnit or TestNG. For instructions on how to add the library to a Java project, see Running tests with JMockit. In this tutorial we examine the APIs available in the library, with the help of example tests (using Java 8). The central API - a single annotation - provides support for the automatic instantiation and initialization of the objects to be tested. Then we have the mocking API (also known as the "Expectations" API), intended for tests which use mocked dependencies. Finally, there is a small faking API (aka the "Mockups" API), which can be used for the creation and application of fake implementations that avoid the full cost of external components.
Learn more
Pricing
Starting Price:
Free
Free Version:
Free Version available.
Company Information
MockK
mockk.io
Other Useful Business Software
Find Hidden Risks in Windows Task Scheduler
Windows Task Scheduler might be hiding critical failures. Download the free JAMS diagnostic tool to uncover problems before they impact production—get a color-coded risk report with clear remediation steps in minutes.
Product Details
Platforms Supported
Windows
Mac
Linux
Training
Documentation
Support
Online