microcks / microcks-quarkus

Quarkus extension that enables embedding Microcks as a DevService managing mocks for dependencies and contract-testing your API endpoints
https://microcks.io
Apache License 2.0
15 stars 3 forks source link

Add auto-discovery of artifacts to import #16

Closed lbroudoux closed 11 months ago

lbroudoux commented 11 months ago

Reason/Context

In the "Quarkus spirit" of Developer Joy, Convention over Configuration, and reducing plumbing & friction, it could be nice to implement auto-discovery of artifacts to import.

So instead of having to declare these specific properties in application.properties:

quarkus.microcks.devservices.artifacts.primaries=target/classes/order-service-openapi.yaml,target/test-classes/third-parties/apipastries-openapi.yaml,target/test-classes/third-parties/hello-v1.proto
quarkus.microcks.devservices.artifacts.secondaries=target/test-classes/third-parties/apipastries-postman-collection.json,target/test-classes/third-parties/HelloService-postman-collection.json,target/test-classes/third-parties/HelloService-metadata.yml

we could rely on conventions so that artifacts located under src/main/resources and src/test/resources may be automatically discovered and imported into the MicrocksContainer during DevService startup.

Description

This auto-discovery mechanism will only be applied if no quarkus.microcks.devservices.artifacts.* is defined.

We propose to rely on naming conventions:

Implementation ideas

No response

edeandrea commented 11 months ago

Just for FYI - a .proto file would never be in src/main/resources. The grpc maven plugin looks in src/main/proto for those files. Maybe that location should be added to the search path for .proto files?

Similar with avro - those would be in src/main/avro

lbroudoux commented 11 months ago

Thanks for your comment @edeandrea. Will take in account for a next enhancement 😉