Skip to content
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

Merged
merged 5 commits into from
Jun 27, 2024

Conversation

nathansandi
Copy link
Contributor

@nathansandi nathansandi commented Jun 17, 2024

Description

Unit test implementation for the follow Pull-Request:
#19273

closes ##19210

@nathansandi nathansandi self-assigned this Jun 17, 2024
@nathansandi nathansandi added the component/zeebe Related to the Zeebe component/team label Jun 17, 2024
@nathansandi nathansandi marked this pull request as ready for review June 17, 2024 12:00
Copy link
Member

@romansmirnov romansmirnov left a 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

  1. Test all filter options
  2. Test variations of specific filter options (like passing only one value or multiple values, ...)
  3. Test the sorting options

@nathansandi nathansandi changed the title test: include tests for user task filter services test: include tests for user task filter services and increase variable tests Jun 18, 2024
@nathansandi nathansandi changed the title test: include tests for user task filter services and increase variable tests test: include tests for user task filter services and increase coverage variable tests Jun 18, 2024
@nathansandi nathansandi changed the base branch from zeebe/taskquery-service to zeebe/variables-query-service June 18, 2024 10:38
@nathansandi nathansandi force-pushed the zeebe/user-task-camunda-tests branch from 3cd95fa to d1914a2 Compare June 18, 2024 14:00
@nathansandi nathansandi requested review from romansmirnov and removed request for tmetzke and marcosgvieira June 18, 2024 14:01
@nathansandi
Copy link
Contributor Author

@nathansandi, the test coverage has to be increased here. IMO, we should do the following

  1. Test all filter options
  2. Test variations of specific filter options (like passing only one value or multiple values, ...)
  3. Test the sorting options

Thank you @romansmirnov I increased the test coverage over here to check if the filters has being applying as well the sort.

Base automatically changed from zeebe/variables-query-service to zeebe/taskquery-service June 19, 2024 13:16
github-merge-queue bot pushed a commit that referenced this pull request Jun 19, 2024
## 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
Base automatically changed from zeebe/taskquery-service to main June 19, 2024 14:44
Copy link
Member

@romansmirnov romansmirnov left a 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.

@nathansandi nathansandi added this pull request to the merge queue Jun 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 26, 2024
@nathansandi nathansandi added this pull request to the merge queue Jun 27, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 27, 2024
@nathansandi nathansandi added this pull request to the merge queue Jun 27, 2024
Merged via the queue into main with commit 733c791 Jun 27, 2024
26 checks passed
@nathansandi nathansandi deleted the zeebe/user-task-camunda-tests branch June 27, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/zeebe Related to the Zeebe component/team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants