WireMock • Using them together • And examples! C/C++, Golang, Rust 4 bit.ly/qatest2023_wiremock Disclaimer: This is a talk about “WireMock AND Testcontainers”, not “VERSUS” ir “OR”. Your mileage may vary These slides:
APIS SINCE 2005 Over 90% of developers use APIs. Skyrocket growth of APIs JANUARY 2006 JANUARY 2008 JANUARY 2010 JANUARY 2012 JANUARY 2014 JANUARY 2016 JANUARY 2018 MONTH The growth over time of the Programmable Web API API directory to more than 22,000 entries 22000 20000 18000 16000 14000 12000 10000 8000 6000 4000 2000 0 TOTAL API COUNT Programmable Web * Gartner Hype Cycle for APIs, 2022
servers 2. Testing against a simplified/containerized instance (e.g. Testcontainers) 3. Mocking at the API provider level (e.g. WireMock) 4. Mocking at the code level 18 Slow Fast Accu- rate Nope
servers 2. Testing against a simplified/containerized instance (e.g. Testcontainers) 3. Mocking at the API provider level (e.g. WireMock) 4. Mocking at the code level 19 Slow Fast Nope Accu- rate
servers 2. Testing against a simplified/containerized instance (e.g. Testcontainers) 3. Mocking at the API provider level (e.g. WireMock) 4. Mocking at the code level 24 Slow Fast Accu- rate Nope
servers 2. Testing against a simplified/containerized instance (e.g. Testcontainers) 3. Mocking at the API provider level (e.g. WireMock) 4. Mocking at the code level 31 Slow Fast Accu- rate Nope
APIs Created in 2011 as a Java test library and CLI Available beyond Java, inc Rust or Golang You can can: • Create stable development environments • Isolate yourself from flakey 3rd parties • Simulate APIs that don't exist yet wiremock.org
a simplified/containerized instance (e.g. Testcontainers) 3. Mocking at the API provider level (e.g. WireMock) 4. Mocking at the code level 39 Slow Fast Nope Accu- rate
September 2023 We have Embedded/Automotive customers and users who need it Based on Testcontainers or Go WireMock module github.com/testcontainers/testcontainers-c
APIs and services, reducing external dependencies, containers • There are tools for that, including WireMock and Testcontainers • WireMock and Testcontainers co-exist well • They work for embedded use-cases!
vary ** You will often need both and that’s OK! Need database or complex dynamic environment? Yes Server implementation is ready? Is it containerized and lightweight? Can you [easily] transfer the system to the required state in test? No No No No Yes Yes Yes 54
WireMock creator is a co-founder of the Inc. • WireMock Cloud - SaaS for end-to-end API mocking • Private beta: K8s Edition for managed / on-premises wiremock.io