Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Quarkus, Gradle, WireMock. Dev Services for Gra...

Quarkus, Gradle, WireMock. Dev Services for Gradle projects

Quarkus has many local development capabilities, including the recently released Dev Services that usually run with Testcontainers under the hood. We can leverage Dev Services to provide real-time API provider development experiences for Quarkus-based services and client apps.

In this session, I provide an overview of using Quarkus and its Dev Services in Gradle projects. We take WireMock as an example. I will show how to develop a REST API and gRPC 3-tier client-service-database app with the help of Quarkus, Gradle, and WireMock. DM for the Testcontainers edition!.

Demo: https://github.com/oleg-nenashev/gradle-quarkus-plugin-demo

Oleg Nenashev

March 14, 2024
Tweet

Resources

More Decks by Oleg Nenashev

Transcript

  1. > whoami @oleg_nenashev oleg-nenashev Dr. Nenashev / Mr. Jenkins Developer

    tools hacker Community builder FOSS/DevRel consultant #RussiansAgainstPutin #StandWithUkraine
  2. My Open [and not so] Communities Time * Once a

    contributor, [almost] always a contributor Neuchâtel
  3. > whoami --quarkus • Jenkins on Quarkus experiments • Jenkinsfile

    Runner native exec with Quarkus • FaaScinator pet project 10
  4. > whoami --quarkus • Jenkins on Quarkus experiments • Jenkinsfile

    Runner native exec with Quarkus • FaaScinator pet project • WireMock Dev Service • Now: Quarkus and Gradle 12
  5. Quarkus is great for building REST APIs 14 • Built-in

    support • Many extensions • Developer experience code.quarkus.io
  6. Ways to do API integration testing 1. Testing against Production/Staging

    servers 2. Testing against a simplified/containerized instance (e.g. Testcontainers) 3. Modeling (aka Mocking) at the API provider level (e.g. WireMock or Microcks) 4. Mocking at the code level 21 Slow Fast Nope Accu- rate * For Testcontainers, see the slides
  7. 22 wiremock.org/docs/stubbing IF (request_url) THEN (response) * * it gets

    MUCH more complex WireMock Config JSON: Client library response request Client App Mock API Server HTTP/2 API Mocking 101
  8. API Mocking for Quarkus 23 Main implementation in Java Native

    lib, Docker images and Testcontainers modules Support for GraalVM Unofficial Quarkus Dev Service Sandbox CNCF Project Golang / Microservice arch Docker image, Testcontainers module Unofficial Quarkus Dev Service
  9. 24 Staging & QA Tests Build Integration tests Build Tests

    Gaining confidence in you software “Shift Left”
  10. Quarkus Plugin for Gradle 33 • Under active development •

    Collaboration between Red Hat and Gradle teams • Basic Quarkus features are supported • Dev mode: ./gradlew quarkusDev • Or just “quarkus dev”! quarkus.io/guides/gradle-tooling
  11. + 41 • WiP: Develocity Pilot in Quarkus • For

    many open source projects: Gradle sponsors Develocity licenses/hosting, helps with build optimization and developer productivity • Maven, Bazel and sbt projects welcome gradle/develocity-oss-projects
  12. What I’m looking forward to? • Feedback on Gradle Plugin

    for Quarkus • Promoting WireMock and Microcks Dev Services as official ones • Quarkus, Gradle and Develocity developer experiences • Any other feedback on Gradle :) 42
  13. References My demo: • Gradle: https://github.com/oleg-nenashev/gradle-quarkus-plugin-demo • Similar one in

    Maven: WireMock extension for Quarkus: • https://docs.quarkiverse.io/quarkus-wiremock • https://github.com/gscaramuzzino/quarkus-wiremock-testing • https://quarkus.io/guides/getting-started-testing#quarkus-test-resource 43