https://github.com/specmatic/specmatic-order-bff-jms
This sample project demonstrates how we can practice contract-driven development and contract testing in a SpringBoot (Kotlin) application that depends on an external domain service and JMS..
https://github.com/specmatic/specmatic-order-bff-jms
sample-project
Last synced: about 1 month ago
JSON representation
This sample project demonstrates how we can practice contract-driven development and contract testing in a SpringBoot (Kotlin) application that depends on an external domain service and JMS..
- Host: GitHub
- URL: https://github.com/specmatic/specmatic-order-bff-jms
- Owner: specmatic
- License: mit
- Created: 2023-07-20T09:06:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-07-08T00:43:13.000Z (about 1 month ago)
- Last Synced: 2026-07-08T02:14:44.769Z (about 1 month ago)
- Topics: sample-project
- Language: Kotlin
- Size: 6.12 MB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: License.md
Awesome Lists containing this project
README
# Specmatic Sample: SpringBoot BFF calling Domain API and JMS
* [Specmatic Website](https://specmatic.io)
* [Specmatic Documentation](https://docs.specmatic.io)
This sample project demonstrates how we can practice contract-driven development and contract testing in a SpringBoot (Kotlin) application that depends on an external domain service and JMS.
Here, Specmatic is used to stub calls to domain API service based on its OpenAPI spec and mock JMS based on its AsyncAPI spec.
Please contact us at https://specmatic.io if you wish to try it out.
Here is the domain api [contract/open api spec](https://github.com/specmatic/specmatic-order-contracts/blob/main/io/specmatic/examples/store/openapi/api_order_v1.yaml)
Here is the [AsyncAPI spec](https://github.com/specmatic/specmatic-order-contracts/blob/main/io/specmatic/examples/store/asyncapi/jms.yaml) of JMS that defines queues and message schema.
## Definitions
* BFF: Backend for Front End
* Domain API: API managing the domain model
* specmatic mock/Mock Server: Create a server that can act as a real service using its OpenAPI or AsyncAPI spec
## Background
A typical web application might look like this. We can use Specmatic to practice contract-driven development and test all the components mentioned below. In this sample project, we look at how to do this for nodejs BFF which is dependent on Domain API Service and JMS demonstrating both OpenAPI and AsyncAPI support in specmatic.

## Tech
1. Spring boot
2. Specmatic
3. Specmatic JMS
4. Karate
## Start BFF Server
This will start the springBoot BFF server
- On Unix and Windows Powershell, please run:
```shell
./gradlew bootRun
```
- On Windows Command Prompt, please run:
```shell
gradlew bootRun
```
Access find orders api at http://localhost:8080/findAvailableProducts
_*Note:* Unless domain api service is running on port 9000 and JMS is set up, above requests will fail.
## Run Tests
This will start the specmatic mock server for domain api using the information in specmatic.json and run the karate tests that expects the domain api at port 9000.
- On Unix and Windows Powershell, please run:
```shell
./gradlew test
```
- On Windows Command Prompt, please run:
```shell
gradlew test
```