-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggies sprint10 staging #127
base: master
Are you sure you want to change the base?
Conversation
kaladay
commented
Nov 11, 2024
- Add unit test for prePersist() from EmbeddedInput. #120
- Directory task unit testing #121
- MODWRKFLOW-34: Mod Workflow should support kafka messaging instead of active mq. #122
- Add support for Jacoco to allow for local coverage reports. #124
- Unit tests created for prePersist() #125
- Add additional unit tests for "has" functions for EmbeddedLoopReference. #126
- FOLIO uses 2-space spacing/tabbing. - Use the `@Mock` annotation whenever possible. - Restore the MockMVC Constants for mocking the TENANT and TOKEN provided by the spring-module-core test project.
…stent. The patterns should use `workflow-engine` for the engine. The engine happens to be Camunda in this particular case but this path should not be tied to Camunda. The module name should be in there as well, which would be `mod-workflow`. The combination does not need to be `mod-workflow-workflow-engine` as that seems silly. Instead, the second `-workflow` is dropped.
…patterns. Use the `@BeforeEach`. - I suspect that the `ReflectionTestUtils.setField...` could be defined as a `@BeforeAll`, but I decided to withhold going further at this time. The standard practice is to use `provide...` for the stream provider method names. Then, the generic `Stream.of()` are used rather than using explicit types. Next, the conditional methods are added as a parameter. - The conditional parameters will allow us to add more extensive tests using the same provider in the future.
The Camunda base path and the Camunda reset path are needed. When going through OKAPI REST end points, these paths represent the OKAPI REST path. This is not necessarily a path to where mod-camunda actually listens on. This commit puts the code back in a state where the Camunda OKAPI REST paths are less hardcoded. Remove the code smells regarding logging an error and throwing an exception at the same time that was introduced when the path changes were made. Update the debug log to show both the tenant and token regardless of whether or not they are NULL. Also use a single message to reduce the amount of log spamming that can happen due to this being called on every request. Update the `application.yml` from the tests to more closely match the `application.yml` from the normal build. The changes being reverted introduced problems and are outside the scope of a change from ActiveMQ to Kafka. The `restPath` variables should probably be refactored to the `workflow-engine` rather than `rest`. However, this has been out of scope and there are other issues set aside for handling this.
- Add missing environment variables. - Add environment variables that may have a significant impact on the OKAPI REST usage, such as `OKAPI_CAMUNDA_BASEPATH` and `OKAPI_CAMUNDA_RESTPATH`. - Add missing periods in several of the descriptions.
The `openapi.xml` file is rebuilt using `mvn clean verify -P openapi`. Changes to the module descriptor or the controller end points require rebuilding of the OpenAPI file.
The `workflow-engine` is what needs to be used. However, that is a different issue and is out of scope. Leave this as `camunda` to stay within the scope of the issue being resolved.
Fix the permissions section and clean up the environment variable table.
This only provides `prePersists()` tests for the following classes: - `AbstractGateway` - `AbstractProcess` - `AbstractTask` - `CompressFile` - `EmbeddedInput`
MODWRKFLOW-34: Mod Workflow should support kafka messaging instead of active mq.
Added extra line as per suggestion
This can be tested by doing the following: ```shell mvn clean test jacoco:report firefox components/target/site/jacoco/index.html firefox service/target/site/jacoco/index.html ```
Add support for Jacoco to allow for local coverage reports.
Directory task unit testing
Add unit test for prePersist() from EmbeddedInput.
…onTest.java Added to a new line Co-authored-by: Kevin Day <[email protected]>
Unit tests created for prePersist()
Add additional unit tests for "has" functions for EmbeddedLoopReference.
The `openapi.xml` file is rebuilt using `mvn clean verify -P openapi`.
| DB_QUERYTIMEOUT | 60000 | Database query timeout. | | ||
| DB_USERNAME | folio_admin | Postgres user name. | | ||
| JAVA_OPTIONS | `-XX:MaxRAMPercentage=75.0` | Java options. | | ||
| KAFKA_HOST | kafka | Kafka broker host name. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| KAFKA_HOST | kafka | Kafka broker host name. | | |
| KAFKA_HOST | kafka | Kafka broker hostname. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -91,7 +94,7 @@ public Map<String, List<Handler>> getHandlers(String tenant, String id) throws I | |||
} | |||
|
|||
public JsonNode getModules(String tenant) { | |||
String url = okapiUrl + PROXY_TENANT_BASE_PATH + tenant + MODULES_SUB_PATH; | |||
String url = okapiUrl + basePath + PROXY_TENANT_BASE_PATH + tenant + MODULES_SUB_PATH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct. See line 33 and 34. Okapi requests to /_/proxy/tenants/
and /_/proxy/modules/
will be incorrect if prefexid with mod-camunda base-path anything other than /
. Even then a URL with consecutive double forward slashes is concatenated.
Additional, okapiUrl
should have any trailing forward slash removed to be safe.
domain-packages: | ||
- org.folio.rest.workflow.components | ||
- org.folio.rest.workflow.model | ||
schema-scripts: | ||
|
||
okapi: | ||
url: ${OKAPI_URL:http://localhost:9130} | ||
camunda: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you help explain again why both of these paths are required for mod-workflow to communicate with mod-camunda through Okapi? Is there some limitation with Camunda Dashboard or its configuration for the Camunda API?