As of today, loading artifacts into the Microcks container should be done after the container is started-up using 2 methods:
importAsMainArtifact(File artifact) or,
importAsSecondaryArtifact(File artifact)
However, this way of doing things doesn't really fit with existing modules' logic - all of them have withSomething() fluent API style methods that allow definition of config at creation. Moreover, our approach can be sometimes harder to achieve cause it means you have to retrieve the container once-initialized (depending on test framework this can tricky) to import artifacts.
Description
Ideally, we'd like to be able to have something like:
MicrocksContainer microcks = new MicrocksContainer(IMAGE)
.withMainArtifacts("apipastries-openapi.yaml")
.withSecondaryArtifacts("apipastries-postman-collection.json");
Implementation ideas
Thanks to lifecycle methods like protected void containerIsStarted(InspectContainerResponse containerInfo). existing on GenericContainer, it should be possible to delay the loading of artifact just after the container is running and healthy.
Reason/Context
As of today, loading artifacts into the Microcks container should be done after the container is started-up using 2 methods:
importAsMainArtifact(File artifact)
or,importAsSecondaryArtifact(File artifact)
However, this way of doing things doesn't really fit with existing modules' logic - all of them have
withSomething()
fluent API style methods that allow definition of config at creation. Moreover, our approach can be sometimes harder to achieve cause it means you have to retrieve the container once-initialized (depending on test framework this can tricky) to import artifacts.Description
Ideally, we'd like to be able to have something like:
Implementation ideas
Thanks to lifecycle methods like
protected void containerIsStarted(InspectContainerResponse containerInfo)
. existing onGenericContainer
, it should be possible to delay the loading of artifact just after the container is running and healthy.