Background:
It would be useful to be able to randomize ports that can be then used inside Knot.x configuration. It would make full test parallelism possible and isolate each test case from one another.
Steps needed:
[x] Evaluate Knot.x configuration inside io.knotx.junit5.KnotxExtension#loadKnotxConfig through KnotxConcatConfigProcessor
[x] Detect if test.random.<identifier>.port is present in generated config
[x] Generate random port for each identifier (proposed lib: me.alexpanov:free-port-finder:1.1.1)
[x] Create JSON override with these ports filled
[x] Evaluate Knot.x config again, with all overrides applied (this is because HOCON lib does not appear to have any "stich these files together and return as not evaluated config string" method)
[x] Store randomized ports, with ability to retrieve them based on test class and method names
[x] Inject randomized port into given test method parameters
Recommended to test this feature on knotx-stack or knotx-data-bridge modules, ideally on both, with test parallelism enabled.
Background:
It would be useful to be able to randomize ports that can be then used inside Knot.x configuration. It would make full test parallelism possible and isolate each test case from one another.
Steps needed:
io.knotx.junit5.KnotxExtension#loadKnotxConfig
throughKnotxConcatConfigProcessor
test.random.<identifier>.port
is present in generated configme.alexpanov:free-port-finder:1.1.1
)Recommended to test this feature on knotx-stack or knotx-data-bridge modules, ideally on both, with test parallelism enabled.