Skip to content

Commit ae0c0ba

Browse files
committed
fix some typos and add docker imagetools inspect commands for supply chain
Signed-off-by: Laurent Broudoux <laurent.broudoux@gmail.com>
1 parent 5ad6a4e commit ae0c0ba

File tree

3 files changed

+46
-28
lines changed

3 files changed

+46
-28
lines changed

content/blog/testcontainers-modules-0.3.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,38 @@ description: "Announcing Testcontainers Modules 0.3"
88
draft: false
99
---
1010

11-
To start the 2025 Year fresh, we're delighted to announce the release of the new series of our [Testcontainers](https://www.testcontainers.com) Modules 🧊!
12-
[Microcks modules](https://testcontainers.com/modules/microcks) are language-specific libraries that enable embedding Microcks into your unit tests with lightweight,
13-
throwaway instances thanks to containers.
11+
To start the 2025 Year fresh, we're delighted to announce the release of the new series of our [Testcontainers](https://www.testcontainers.com)
12+
Modules 🧊! [Microcks modules](https://testcontainers.com/modules/microcks) are language-specific libraries that enable embedding Microcks into
13+
your unit tests with lightweight, throwaway instances thanks to containers.
1414

1515
The `0.3` series is a major step forward that completes the set of features and elevates Microcks as **a fully featured mocking library for development purposes**.
16-
It can be used with different testing styles (classicist, mockist, state-based, and interaction-based) and provides features for all major languages and all kinds of API!
16+
It can be used with different testing styles (classicist, mockist, state-based, and interaction-based) and provides features for all major
17+
languages and all kinds of API!
1718

1819
{{< image src="images/blog/testcontainers-modules-0.3-feature.png" alt="image" zoomable="true" >}}
1920
<div align="center" style="padding-bottom: 40px"><legend><small><i>Photo by Alexandre Boucey on Unsplash</i></small></legend></div>
2021

2122
The `0.3` versions are coincident releases made last week on the three main languages we currently support: [Java ☕️](https://github.com/microcks/microcks-testcontainers-java),
2223
[NodeJS/Typescript](https://github.com/microcks/microcks-testcontainers-node) and [Golang](https://github.com/microcks/microcks-testcontainers-go).
23-
With those new releases, we now have complete feature parity among the three different technology stacks! We plan to add the same features to the upcoming
24-
[.NET module](https://github.com/microcks/microcks-testcontainers-dotnet) that we added to our portfolio in December 2024.
24+
With those new releases, we now have complete feature parity among the three different technology stacks! We plan to add the same features to
25+
the upcoming [.NET module](https://github.com/microcks/microcks-testcontainers-dotnet) that we added to our portfolio in December 2024.
2526

2627
Let's introduce the new features of those releases that complete the picture!
2728

2829
## What's inside?
2930

3031
#### 1️⃣ Interaction checks
3132

32-
If you spend some time reading about unit Test Driven Development, you may know that it exists two main school of thoughts: the *Classicist* and the *Mockist*.
33+
If you spend some time reading about Test Driven Development, you may know that it exists two main school of thought: the *Classicist* and the *Mockist*.
3334
(more on this in [this excellent article](https://medium.com/@adrianbooth/test-driven-development-wars-detroit-vs-london-classicist-vs-mockist-9956c78ae95f))
3435

3536
Until now, Microcks Testcontainers integration was *Classicist* in the sense that it was focused on providing canned responses when the mocks
3637
endpoints were called. With this `0.3` release, we now also have a *Mockist* approach in the case you want to check the interactions of your
3738
component under test with a dependant API.
3839

39-
You can now call `verify()` or `getServiceInvocationsCount()` on a Microcks container to check an API dependency has actually been called - or not.
40-
This is a super powerful way to ensure that your application logic (when to interact with an API) and access policies (caching, no caching, etc.) are correctly
41-
implemented and use the mock endpoints only when required!
40+
You can now call `verify()` or `getServiceInvocationsCount()` on a Microcks container to check whether an API dependency has actually been
41+
called - or not. This is a super powerful way to ensure that your application logic (when to interact with an API) and access policies (caching,
42+
no caching, etc.) are correctly implemented and use the mock endpoints only when required!
4243

4344
{{< image src="images/blog/testcontainers-modules-0.3-interaction.png" alt="image" zoomable="true" >}}
4445

@@ -48,17 +49,17 @@ A big shout out to [pierrechirstinimsa](https://github.com/pierrechristinimsa)
4849
#### 2️⃣ Access to `messages` in synchronous API contract-testing
4950

5051
The second thing we added in this release is the ability to retrieve exchanged messages when doing contract-testing. Different
51-
[contract-testing runners](https://microcks.io/documentation/references/test-endpoints/#test-runner) already exists in Microcks but they're mainly focused on
52-
**syntactical conformance** checking. However, we know that there are [multiple levels of contract testing](https://medium.com/@lbroudoux/different-levels-of-api-contract-testing-with-microcks-ccc0847f8c97).
52+
[contract-testing runners](https://microcks.io/documentation/references/test-endpoints/#test-runner) already exists in Microcks but they're
53+
mainly focused on **syntactical conformance** checking. However, we know that there are [multiple levels of contract testing](https://medium.com/@lbroudoux/different-levels-of-api-contract-testing-with-microcks-ccc0847f8c97).
5354

54-
The new `getMessagesForTestCase()` function on Microcks container allows you to retrieve the requests and responses that were used during an operation tests case.
55-
You can then use them to perform extra checks more related to **business conformance**; validating, for example, that data retrieval or transformation logic is
56-
correctly implemented.
55+
The new `getMessagesForTestCase()` function on Microcks container allows you to retrieve the requests and responses that were used during an
56+
operation tests case. You can then use them to perform extra checks more related to **business conformance**; validating, for example, that
57+
data retrieval or transformation logic is correctly implemented.
5758

5859
{{< image src="images/blog/testcontainers-modules-0.3-messages.png" alt="image" zoomable="true" >}}
5960

6061
These extra checks can be done *manually* directly in the programming language of your tests but you can also delegate them
61-
to frameworks like [Cucumber](https://cucumber.io/) for running acceptance tests, written in plain language by business experts!
62+
to frameworks like [Cucumber](https://cucumber.io/) which are written in plain language by business experts; for running acceptance tests!
6263

6364

6465
#### 3️⃣ Access to `events` in asynchronous EDA contract-testing
@@ -84,18 +85,17 @@ events were not sent at the right time, introducing de-synchronization and colli
8485
## Enthusiastic?
8586

8687
We hope this walkthrough has made you enthusiastic about this new set of features in Microcks Testcontainers `0.3`! The best thing is that you don't have
87-
to wait another Microcks release to test them out as thy're are leveraging APIs and features that are present for a long time in Microcks core!
88+
to wait another Microcks release to test them out as they're are leveraging APIs and features that are present for a long time in Microcks core!
8889

8990
If you want to learn them and see them in action, we have completed our demonstration application and tutorials on Testcontainers Modules as well!
9091
You just have to check the following links:
9192

92-
* **For Java ☕️:** [How to check the mock endpoints are actually used?](https://github.com/microcks/microcks-testcontainers-java-spring-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---check-the-mock-endpoints-are-actually-used), [How to verify the business conformance of a synchronous API](https://github.com/microcks/microcks-testcontainers-java-spring-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---verify-the-business-conformance-of-order-service-api-in-pure-java), and [How to verify the event content for an asynchronous API](https://github.com/microcks/microcks-testcontainers-java-spring-demo/blob/main/step-5-write-async-tests.md#-bonus-step---verify-the-event-content)
93+
* **For Java ☕️:** [How to check the mock endpoints are actually used](https://github.com/microcks/microcks-testcontainers-java-spring-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---check-the-mock-endpoints-are-actually-used), [How to verify the business conformance of a synchronous API](https://github.com/microcks/microcks-testcontainers-java-spring-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---verify-the-business-conformance-of-order-service-api-in-pure-java), and [How to verify the event content for an asynchronous API](https://github.com/microcks/microcks-testcontainers-java-spring-demo/blob/main/step-5-write-async-tests.md#-bonus-step---verify-the-event-content)
9394

9495
* **For NodeJS/TypeScript:** [How to check the mock endpoints are actually used](https://github.com/microcks/microcks-testcontainers-node-nest-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---check-the-mock-endpoints-are-actually-used), [How to verify the business conformance of a synchronous API](https://github.com/microcks/microcks-testcontainers-node-nest-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---verify-the-business-conformance-of-order-service-api-in-pure-java), and [How to verify the event content for an asynchronous API](https://github.com/microcks/microcks-testcontainers-node-nest-demo/blob/main/step-5-write-async-tests.md#-bonus-step---verify-the-event-content)
9596

9697
* **For Golang:** [How to check the mock endpoints are actually used](https://github.com/microcks/microcks-testcontainers-go-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---check-the-mock-endpoints-are-actually-used), [How to verify the business conformance of a synchronous API](https://github.com/microcks/microcks-testcontainers-go-demo/blob/main/step-4-write-rest-tests.md#-bonus-step---verify-the-business-conformance-of-order-service-api-in-pure-java), and [How to verify the event content for an asynchronous API](https://github.com/microcks/microcks-testcontainers-go-demo/blob/main/step-5-write-async-tests.md#-bonus-step---verify-the-event-content)
9798

98-
As usual, we’re eager for community feedback: come and discuss on our [Discord chat](https://microcks.io/discord-invite/) 🐙
99+
As usual, we’re eager for community feedback: come and discuss on our [Discord chat](https://microcks.io/discord-invite/) 👻
99100

100101
Thanks for reading and supporting us!
101-

content/documentation/references/container-images.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ draft: false
33
title: "Container Images"
44
date: 2024-05-13
55
publishdate: 2024-05-13
6-
lastmod: 2024-12-06
6+
lastmod: 2025-01-13
77
weight: 1
88
---
99

@@ -166,10 +166,17 @@ You can then extract the `logIndex` and connect to [Rekor](https://search.sigsto
166166
All our images are built with a [SLSA Provenance](https://slsa.dev/spec/v1.0/provenance#v02) attestation (currently in `v0.2`). This attestation is attached as a layer of a
167167
metadata manifest of the main image index.
168168

169-
As Microcks images are provided for `linux/amd64` and `linux/arm64` architectures, the 2 first manifests of an image index are reserved for these architectures. Then, starting
170-
at index 2 come the metadata manifests from where you can extract attestations that are formatted as [in-toto predicates](https://github.com/in-toto/attestation/tree/v1.0/spec/predicates).
169+
You can quickly inspect the `Provenance` attestations value using the `imagestools inspect` tool from `docker`like this:
171170

172-
For example: you can extract the Provenance of the `microcks:nightly` image using those commands - using [ORAS](https://oras.land/) utility:
171+
```sh
172+
docker buildx imagetools inspect quay.io/microcks/microcks:nightly --format "{{ json .Provenance }}"
173+
```
174+
175+
If you need to get access to the raw [in-toto predicates](https://github.com/in-toto/attestation/tree/v1.0/spec/predicates), you can use a tool like [ORAS](https://oras.land/) utility.
176+
177+
As Microcks images are provided for `linux/amd64` and `linux/arm64` architectures, the 2 first manifests of an image index are reserved for these architectures. Then, starting
178+
at index 2 come the metadata manifests from where you can extract in-toto attestations. For example: you can extract the Provenance of the `microcks:nightly` image using those
179+
commands:
173180

174181
```sh
175182
PROVENANCE_DIGEST=`docker manifest inspect --verbose quay.io/microcks/microcks:nightly | jq -r '.[2].OCIManifest.layers | map(select(.annotations."in-toto.io/predicate-type" == "https://slsa.dev/provenance/v0.2") | .digest)[0]'`
@@ -257,10 +264,17 @@ You can find in the attestation the GitHub source and revision, the base image u
257264

258265
All our images are built with a [SPDX SBOM](https://spdx.dev/) attestation (currently in `v2.3`). This attestation is attached as a layer of a metadata manifest of the main image index.
259266

260-
As Microcks images are provided for `linux/amd64` and `linux/arm64` architectures, the 2 first manifests of an image index are reserved for these architectures. Then, starting
261-
at index 2 come the metadata manifests from where you can extract attestations that are formatted as [in-toto predicates](https://github.com/in-toto/attestation/tree/v1.0/spec/predicates).
267+
You can quickly inspect the `Provenance` attestations value using the `imagestools inspect` tool from `docker`like this:
268+
269+
```sh
270+
docker buildx imagetools inspect quay.io/microcks/microcks-postman-runtime:nightly --format "{{ json .SBOM }}"
271+
```
272+
273+
If you need to get access to the raw [in-toto predicates](https://github.com/in-toto/attestation/tree/v1.0/spec/predicates), you can use a tool like [ORAS](https://oras.land/) utility.
262274

263-
For example: you can extract the SBOM of the `microcks-postman-runtime:nightly` image using those commands - using [ORAS](https://oras.land/) utility:
275+
As Microcks images are provided for `linux/amd64` and `linux/arm64` architectures, the 2 first manifests of an image index are reserved for these architectures. Then, starting
276+
at index 2 come the metadata manifests from where you can extract in-toto attestations. For example: you can extract the SBOM of the `microcks-postman-runtime:nightly` image
277+
using those commands:
264278

265279
```sh
266280
SBOM_DIGEST=`docker manifest inspect --verbose quay.io/microcks/microcks-postman-runtime:nightly | jq -r '.[2].OCIManifest.layers | map(select(.annotations."in-toto.io/predicate-type" == "https://spdx.dev/Document") | .digest)[0]'`

hugo_stats.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"htmlElements": {
33
"tags": [
44
"a",
5-
"base",
65
"blockquote",
76
"body",
87
"br",
@@ -29,6 +28,7 @@
2928
"iframe",
3029
"img",
3130
"input",
31+
"legend",
3232
"li",
3333
"link",
3434
"main",
@@ -368,6 +368,7 @@
368368
"1-import-content-via-upload",
369369
"1-import-tasks-in-your-cluster",
370370
"1-install-the-cli",
371+
"1-interaction-checks",
371372
"1-java-support",
372373
"1-obtain-an-api-key",
373374
"1-preparation",
@@ -384,6 +385,7 @@
384385
"1-setup-schema-registry",
385386
"1-use-cases",
386387
"1-using-testcontainers",
388+
"2-access-to-messages-in-synchronous-api-contract-testing",
387389
"2-authenticate-to-keycloak",
388390
"2-basic-operation-in-openapi",
389391
"2-create-a-snapshot",
@@ -414,6 +416,7 @@
414416
"2-use-rabbitmq-in-asyncapi",
415417
"2-use-tasks-in-a-pipeline",
416418
"2-using-docker-desktop-extension",
419+
"3-access-to-events-in-asynchronous-eda-contract-testing",
417420
"3-adding-a-secret-to-an-import-job",
418421
"3-basic-operation-of-grpc-service",
419422
"3-basic-operation-of-soap-service",
@@ -883,6 +886,7 @@
883886
"whats-coming-next",
884887
"whats-coming-next-",
885888
"whats-in-the-box",
889+
"whats-inside",
886890
"whats-next",
887891
"who-can-use-microcks-for",
888892
"why-do-we-need-you",

0 commit comments

Comments
 (0)