docs: Implementation of Java DSL Cookbook#394
Conversation
ricardozanini
left a comment
There was a problem hiding this comment.
Nice write-up! Either for this cookbook and the YAML one, we must add tests within the docs module. So we guarantee we are not diverting our audience with wrong examples.
Feel free to also open issues on the points I made that are not working as it should.
|
@ricardozanini okay, to update the status. I working on updating the The idea will be as follows: I will add workflow classes for each of the Java DSL example. |
|
@domhanak need help to figure it out the issue? |
|
@ricardozanini not sure I understand your question? Care to elaborate please? |
Just asking if you need any help to solve the issues you may have. |
|
@ricardozanini no worries so far, just need to finish it all the way so I know where we are at. :) Halfway there, working on |
71aa47b to
d5dcd6c
Compare
|
@ricardozanini Let's say the first part is done, there are still some missing but they have a different approach and can't use Not sure if this is expected or these methoed should also be present in |
|
4 Items missing:
|
Either |
|
@ricardozanini @mcruzdev Imho we could proceed with merging this and work on next in new issue. I reported the follow-up - #487 Note: the tests are not being executed right now - I am running the locally via IDE, I think it would be better to ensure that as separate issue once the cookbook is finished. Reported here - #488 Let me know if this is ok. |
|
One thing, that struck me now, is if we should add |
When an application.property is needed? If so, yes we should add an excerpt of it. |
ricardozanini
left a comment
There was a problem hiding this comment.
That's outstanding work! Many thanks!
|
@mcruzdev @ricardozanini updated with new addition to SDK, please squash if merging. |
| @Override | ||
| public Map<String, String> start() { | ||
| // Start WireMock on the fixed port expected by the example workflows | ||
| wireMockServer = new WireMockServer(8089); |
There was a problem hiding this comment.
| wireMockServer = new WireMockServer(8089); | |
| WireMockConfiguration config = WireMockConfiguration.wireMockConfig().dynamicPort(); | |
| wireMockServer = new WireMockServer(config); |
There was a problem hiding this comment.
And you will probably have to change how Quarkus reads this port like:
return Map.of("wiremock.port", String.valueOf(wireMockServer.port()));Then use it in the endpoint:
.endpoint("http://localhost:${wiremock.port}/api/people")
We run tests in parallel in many instances.
There was a problem hiding this comment.
Sure, however this is not really a problem now as docs module is skipping tests. I can update here or in the follow-up that specifically aims to make these updates.
| public Map<String, String> start() { | ||
| // 1. Enable WireMock's built-in verbose logging using ConsoleNotifier | ||
| WireMockConfiguration config = WireMockConfiguration.wireMockConfig() | ||
| .port(8090) |
There was a problem hiding this comment.
| .port(8090) | |
| ..dynamicPort() |
|
|
||
| @Inject | ||
| @Identifier("flow:echo-name") // namespace:name from document section | ||
| @Identifier("company:echo-name") // namespace:name from document section |
There was a problem hiding this comment.
Has the YAML referenced by this bean also changed?
There was a problem hiding this comment.
the YAML is fine, I just adapted the test so it works.
| WorkflowDefinition cronFlowDefinition; | ||
|
|
||
| @Test | ||
| void testCronWorkflow() { |
There was a problem hiding this comment.
Why not awaitability?
await().atMost(5, TimeUnit.SECONDS)
.untilAsserted(() ->
assertThat(cronFlowDefinition.scheduledInstances().size()).isGreaterThan(2)
);There was a problem hiding this comment.
True, can do that.

Closes #393
Based on https://docs.quarkiverse.io/quarkus-flow/dev/quarkus-flow-cookbook.html#
Here is the Java version of the cookbook.
@ricardozanini @mcruzdev @fjtirado Putting it up for first feedback round, in the meantime I will work on reviewing the test coverage for these examples.
Once done I will get back to you, right now looking for feedback if this is what is expected to be here.
Also please list out what other cases to add. 🙏