Skip to content

A simple http service to return the name of the mars rovers written in Quarkus

Notifications You must be signed in to change notification settings

wiremock/quarkus-mars-rover-service-http

Repository files navigation

Quarkus Mars Rover Http Service

This service returns a list of Mars Rover names in json in the following format:

[
  {
    "id": 0,
    "name": "Spirit"
  },
  {
    "id": 1,
    "name": "Opportunity"
  },
  {
    "id": 2,
    "name": "Curiosity"
  },
  {
    "id": 3,
    "name": "Perseverance"
  },
  {
    "id": 4,
    "name": "Sojourner"
  }
]

It is designed to be consumed using the mars rover cli to output those names to the command line. These two applications combined show how http services can be mocked using WireMock and the Quarkus WireMock dev service.

If you are new to mocking with WireMock, a good place to start is the Stubbing section of the documentation and then move onto the Request Matching and Response Templating sections.

WireMock Cloud

WireMock Cloud is a managed, hosted version of WireMock, developed by the same team who wrote the open-source project. It's built on the same technology that powers open source WireMock and is 100% compatible with the WireMock API, with additional features that make it quick and easy to mock any API you depend on. WireMock Cloud also introduces advanced capabilities such as chaos engineering, mock creation from openAPI spec, contract testing, import data from CSV files and the newer stateful mock functionality, as well as better collaboration and user management. WireMock Cloud has a free forever plan so take a look and see how WireMock Cloud can fit into your SDLC.

Quarkus

This project uses Quarkus, the Supersonic Subatomic Java Framework.

If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

./gradlew quarkusDev

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

Making Requests

You can find a collection of requests in the form of a JetBrains http file in the src/test folder. This will allow you to make requests and see the responses returned. These can be converted to curl if required:

curl -X GET --location "http://localhost:8080/rovers"

About

A simple http service to return the name of the mars rovers written in Quarkus

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages