-
Notifications
You must be signed in to change notification settings - Fork 565
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
test: include tests for user task filter services and increase coverage variable tests #19434
Conversation
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.
@nathansandi, the test coverage has to be increased here. IMO, we should do the following
- Test all filter options
- Test variations of specific filter options (like passing only one value or multiple values, ...)
- Test the sorting options
feature: increase test coverage and remove variable query
3cd95fa
to
d1914a2
Compare
Thank you @romansmirnov I increased the test coverage over here to check if the filters has being applying as well the sort. |
service/src/main/java/io/camunda/service/transformers/filter/UserTaskFilterTransformer.java
Show resolved
Hide resolved
## Description Create the User Task Filter/Query on Camunda Service Unit tests available on this Pull Request: #19434 Note: This filter will only contemplate User Task, to filter user task variables, this logic will be handled on the endpoint business logic for the performance reasons, only we will have the variable service, and we can divide the search by the tasks that are running vs. tasks that are completed. The variable service is available on this Pull Request: #19385 ## How to test? Example of Java Application ``` public class TestApplication { public static void main(final String[] args) { final var serverUrl = "http://localhost:9200"; final var restClient = RestClient.builder(HttpHost.create(serverUrl)).build(); final var transport = new RestClientTransport(restClient, new JacksonJsonpMapper()); final var esClient = new ElasticsearchClient(transport); final var dataStoreClient = new ElasticsearchSearchClient(esClient); final var camundaServices = new CamundaServices(dataStoreClient); final SearchQueryResult<UserTaskEntity> result = camundaServices .userTaskServices() .search( (q) -> q.page((p) -> p.size(100)) .filter((p) -> p.taskStates("COMPLETED")) .sort((s) -> s.startDate().desc())); result.items().stream().forEach(System.out::println); System.exit(-1); } } ``` ## Related issues closes ##19210
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.
Since this PR mainly focuses on adding test cases, I am hereby approving it. The other topics are not related to this PR in that sense.
Description
Unit test implementation for the follow Pull-Request:
#19273
closes ##19210