Draft:WireMock

From Wikipedia, the free encyclopedia
  • Comment: No independent sources. Please read WP:INDEPENDENT, edit accordingly, and resubmit. Festucalextalk 10:23, 11 July 2023 (UTC)

WireMock
Original author(s)Tom Akehurst
Initial release2011
Repositoryhttps://github.com/wiremock
Written inJava
PlatformJava 11, Java 17
TypeIntegration Testing, API
LicenseApache License v2
Websitehttps://wiremock.org/

(aka API mocking, and hence the name). It is used for Integration Testing of various application interfaces, especially REST API..[1][2]

Features[edit]

WireMock can run in many Unit testing and Integration testing frameworks, including JUnit, TestNG, Testcontainers, Spock and others. It can be also deployed as a standalone service in Docker [3], Kubernetes[4] or as a Java executable.

Key features include:

  • Stubbing and Mocking. WireMock supports HTTP response stubbing, allowing the definition of expected request-response pairs known as "stubs." These stubs simulate the behavior of external services.
  • Request Verification. It offers capabilities for verifying incoming HTTP requests by specifying matching criteria such as HTTP method, URL, headers, and request body.
  • Proxy and Intercept. WireMock enables proxying and interception of HTTP requests, facilitating the analysis of request and response traffic.
  • Record and Playback. It supports the recording of actual HTTP interactions and their subsequent playback, facilitating the creation of stubs based on real-world data.
  • Stateful behavior simulation. It can simulate various response sequences as scenarios or define complex dynamic behavior as a finite state machine[5].

WireMock uses a custom configuration format, but the definitions can be imported from other formats like OpenAPI[6].

History[edit]

WireMock was created in 2011 by Tom Akehurst when working for ioko. The project was released to the public on the 9th of October 2011 under the Apache License v2. It quickly gained traction in the Java community and got adopted in many projects. It was referenced by many sites, including an introduction guide on Baeldung[7].

In 2016, WireMock 2.0 was released. Approximately at the same time, Docker images were introduced to the project by Rodolphe Chaigneau[8]. Support for Android was also introduced and demonstrated by Sam Edwards[9].

In 2019, a first book on WireMock for Java developers was published by Dilip Sundarraj[10]. The same year, Andrew Morgan published a full WireMock 2 course on Pluralsight[11]

In 2022, a new WireMock Inc. company was formed around WireMock, with Tom Akehurst becoming its CTO and Uri Maoz as the CEO. The company builds WireMock Cloud - a SaaS solution and a developer portal for API development productivity platform. In May 2023 WireMock Inc. received a seed investment round and re-emphasized its commitment to the open source ecosystem and growing the community [12]. In June 2023, WireMock Inc became a member of the OpenAPI Initiative[13].

In June 2023, a formal governance model was introduced in the project as part of the effort to grow the contributor community and the ecosystem. A public roadmap was published for the project [14]. Tom Akehurst became the BDFL of the project, a charter of co-maintainers was introduced.

In September 2023, WireMock 3 was released [15]. This release includes many new request filters and other features, drop Java 1.8 support, and reduce the dependencies footprint by using new Java capabilities. There are additional initiatives in preview, including support for gRPC and GraphQL[16] mocking, Testcontainers modules, etc.

In October 2023, WireMock Inc and AtomicJar announced partnership focusing on the Testcontainers ecosystem and announced inclusion if the module into the official program[17]. The WireMock module for Testcontainers includes support for Java, Golang, Python and Node.js. This month, WireMock has also officially participated in Hacktoberfest. The first ever in-person hack days was organized by WireMock in collaboration with the London Java Community and MLH [18].

In December 2023, the WireMock 3 general availability availability was announced [19]. The 4x GitHub contributors growth in 2023 was announced by one of the maintainers[20]

Ecosystem[edit]

WireMock has a diverse ecosystem of extensions, adapters and integrations for different technologies. These allow WireMock to be used with different programming languages and technologies, especially within the Java Virtual Machine ecosystem.

Popular integrations include:

Other Implementations[edit]

WireMock has many 3rd-party implementations for different technology stacks. These implementations are maintained outside the WireMock community governance. They may or may not be fully compatible with WireMock’s official implementation in Java.

Popular server implementations:

There are many other implementations using WireMock Docker and providing wrappers for it, for example Python[27] Golang or JavaScript. There is ongoing effort to consolidate these implementations with help of Testcontainers.

In addition to the extensions, there is a demonstrated use of WireMock with popular development tools and frameworks, for example Micronaut[28] or Quarkus[29]

Education Use[edit]

Beyond its practical applications, WireMock serves as an educational tool, providing developers and testers with insights into API testing, mocking, and the emulation of HTTP interactions.

See Also[edit]

References[edit]

  1. ^ "WireMock Ecosystem and Integrations". WireMock Documentation. Retrieved Dec 30, 2023.
  2. ^ "WireMock Overview". WireMock Documentation. Retrieved June 26, 2023.
  3. ^ Berar, George. "Speed Up Backend Development With WireMock And Docker". Blog. Retrieved Dec 30, 2023.
  4. ^ Lee, Kent. "A Helm chart for WireMock deployment on Kubernetes". Blog. Retrieved Dec 30, 2023.
  5. ^ "Using WireMock Scenarios". Baeldung. Retrieved Nov 14, 2023.
  6. ^ Tanna, Jamie. "Generate a running mock server from an OpenAPI specification using Prism". Blog. Retrieved Dec 30, 2023.
  7. ^ "Introduction to WireMock". Baeldung. Retrieved Nov 14, 2023.
  8. ^ Andrakakis, Jim. "Design by Contract Tutorial: Mock your interfaces using Swagger, WireMock, Docker, Azure DevOps, Terraform AND Azure". Retrieved Nov 14, 2023.
  9. ^ Edwards, Sam. "Running WireMock on Android". Retrieved Nov 14, 2023.
  10. ^ Sundarraj, Dilip. "WireMock for Java Developers". Packt Publishing. Retrieved Nov 14, 2023.
  11. ^ Morgan, Andrew. "Introduction to WireMock 2". Online Course on Pluralsight. Retrieved Nov 14, 2023.
  12. ^ Miller, Ron. "WireMock lands $6.5M to help developers build and test on mock APIs". TechCrunch. Retrieved June 26, 2023.
  13. ^ "WireMock, Venture Funded Open Source API Mock Platform, Joins OpenAPI Initiative as New Member". OpenAPI Initiative. Retrieved Dec 30, 2023.
  14. ^ "WireMock public roadmap". WireMock Community. Retrieved June 26, 2023.
  15. ^ "WireMock 3". WireMock - GitHub Issue. Retrieved June 26, 2023.
  16. ^ Hayashi, Eiki. "Wiremock の GraphQL Extension". Blog post. Retrieved Nov 11, 2023.
  17. ^ "WireMock joins the Testcontainers Official Modules Program". AtomicJar Blog. Retrieved Nov 11, 2023.
  18. ^ "Hacktoberfest 2023 in London: Learn WireMock and contribute to open source". Major League Hacking Event Page. Retrieved Nov 11, 2023.
  19. ^ Nenashev, Oleg. "WireMock 3 goes GA". WireMock Blog. Retrieved Dec 30, 2023.
  20. ^ Nenashev, Oleg. "WireMock New Year Summary". LinkedIn Post. Retrieved Dec 30, 2023.
  21. ^ Walkowiak, Maciej. "WireMock Spring Boot". GitHub. Retrieved June 26, 2023.
  22. ^ "Spring Cloud Contract WireMock". Spring Cloud website. Retrieved June 26, 2023.
  23. ^ "Testcontainers Java module for WireMock". GitHub Repository. Retrieved June 26, 2023.
  24. ^ "Quarkus WireMock". Quarkiverse Documentation. Retrieved Nov 14, 2023.
  25. ^ Piątek, Cezary. "WireMock.NET - Introduction". Blog. Retrieved Nov 14, 2023.
  26. ^ Palmieri, Luca. "Rust Dublin March 2021 remote meetup - wiremock-rs". Meetup Recording. Retrieved Dec 30, 2023.
  27. ^ "Python library for WireMock". GitHub Repository. Retrieved June 26, 2023.
  28. ^ "Testing REST API Integrations Using Testcontainers with WireMock or MockServer". Micronaut Official Documentation. Retrieved Nov 14, 2023.
  29. ^ Porter, Iain. "Building a Resilient Microservice with Quarkus and Wiremock". Blog. Retrieved Nov 14, 2023.