From de0d61de9785a60cf4992ac3fa29c05455649a80 Mon Sep 17 00:00:00 2001 From: Martin Weiler Date: Wed, 14 Feb 2024 09:05:58 -0700 Subject: [PATCH 1/7] [kie-issues#923] Add index to foreign key columns to improve performance in postgresql (#1985) --- .../db/migration/V1.45.0.3__add_fk_index.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/db/migration/V1.45.0.3__add_fk_index.sql diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/db/migration/V1.45.0.3__add_fk_index.sql b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/db/migration/V1.45.0.3__add_fk_index.sql new file mode 100644 index 0000000000..72e909ac55 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/db/migration/V1.45.0.3__add_fk_index.sql @@ -0,0 +1,17 @@ +create index if not exists idx_attachments_tid on attachments(task_id); +create index if not exists idx_comments_tid on comments(task_id); +create index if not exists idx_definitions_addons_pid_pv on definitions_addons(process_id, process_version); +create index if not exists idx_definitions_annotations_pid_pv on definitions_annotations(process_id, process_version); +create index if not exists idx_definitions_metadata_pid_pv on definitions_metadata(process_id, process_version); +create index if not exists idx_definitions_nodes_pid_pv on definitions_nodes(process_id, process_version); +create index if not exists idx_definitions_nodes_metadata_pid_pv on definitions_nodes_metadata(process_id, process_version); +create index if not exists idx_definitions_roles_pid_pv on definitions_roles(process_id, process_version); +create index if not exists idx_milestones_piid on milestones(process_instance_id); +create index if not exists idx_nodes_piid on nodes(process_instance_id); +create index if not exists idx_processes_addons_pid on processes_addons(process_id); +create index if not exists idx_processes_roles_pid on processes_roles(process_id); +create index if not exists idx_tasks_admin_groups_tid on tasks_admin_groups(task_id); +create index if not exists idx_tasks_admin_users_tid on tasks_admin_users(task_id); +create index if not exists idx_tasks_excluded_users_tid on tasks_excluded_users(task_id); +create index if not exists idx_tasks_potential_groups_tid on tasks_potential_groups(task_id); +create index if not exists idx_tasks_potential_users_tid on tasks_potential_users(task_id); From 186436cfc29c809a6fc857a8a70eccb7ba027096 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti <65240126+fjtirado@users.noreply.github.com> Date: Thu, 8 Feb 2024 11:32:26 +0100 Subject: [PATCH 2/7] Removing oracle driver and associated tests (#1971) * Removing oracle driver and associated tests * Revert "Removing oracle driver and associated tests" This reverts commit 5ec3419e0aa9abca21fa69433534b8dd4f1c6020. * Refactory tests * Removing container * Changing names, from oracle to jdbc * Fixing graphql dependency * Renaming oracle package to jdbc * Renaming modules as per Enrique's comments --- .../AbstractProcessDataIndexOracleIT.java | 40 ----- .../oracle/ProcessDataIndexOracleHttpIT.java | 29 --- .../oracle/ProcessDataIndexOracleKafkaIT.java | 29 --- .../quarkus/http/OracleHttpTestProfile.java | 37 ---- .../quarkus/kafka/OracleKafkaTestProfile.java | 36 ---- .../index/ProcessDataIndexOracleIT.java | 61 ------- .../DataIndexOracleSpringTestResource.java | 42 ----- data-index/data-index-common/pom.xml | 4 + .../kogito/index/api}/DateTimeCoercing.java | 2 +- .../index/api}/DefaultDateTimeCoercing.java | 2 +- .../graphql/GraphQLScalarTypeProducer.java | 2 + .../graphql/PostgreSqlDateTimeCoercing.java | 51 ------ .../DateTimeScalarTypeProducerTest.java | 1 + .../graphql/DefaultDateTimeCoercingTest.java | 1 + .../graphql/query/GraphQLQueryMapperTest.java | 2 +- .../src/main/resources/application.properties | 39 ---- .../src/test/docker/docker-compose.yml | 71 -------- .../graphql/OracleDateTimeCoercingTest.java | 89 --------- .../messaging/OracleMessagingLoadKafkaIT.java | 32 ---- .../test/InMemoryMessageTestProfile.java | 36 ---- .../service/test/KafkaMessageTestProfile.java | 42 ----- .../service/test/KeycloakTestProfile.java | 59 ------ .../src/test/resources/application.properties | 63 ------- .../PostgreSqlDateTimeCoercingTest.java | 89 --------- data-index/data-index-service/pom.xml | 5 + .../data-index-storage-jpa-common/pom.xml | 113 ++++++++++++ .../index/jpa/mapper/JobEntityMapper.java | 0 .../mapper/ProcessDefinitionEntityMapper.java | 0 .../mapper/ProcessInstanceEntityMapper.java | 0 .../mapper/UserTaskInstanceEntityMapper.java | 0 .../index/jpa/model/AbstractEntity.java | 0 .../index/jpa/model/AttachmentEntity.java | 0 .../kogito/index/jpa/model/CommentEntity.java | 0 .../kie/kogito/index/jpa/model/JobEntity.java | 0 .../index/jpa/model/JobEntityRepository.java | 0 .../index/jpa/model/MilestoneEntity.java | 0 .../index/jpa/model/MilestoneEntityId.java | 0 .../kogito/index/jpa/model/NodeEntity.java | 0 .../kogito/index/jpa/model/NodeEntityId.java | 0 .../index/jpa/model/NodeInstanceEntity.java | 0 .../jpa/model/ProcessDefinitionEntity.java | 0 .../jpa/model/ProcessDefinitionEntityId.java | 0 .../ProcessDefinitionEntityRepository.java | 0 .../jpa/model/ProcessInstanceEntity.java | 0 .../ProcessInstanceEntityRepository.java | 0 .../jpa/model/ProcessInstanceErrorEntity.java | 0 .../jpa/model/UserTaskInstanceEntity.java | 0 .../UserTaskInstanceEntityRepository.java | 0 .../storage/AbstractJPAStorageFetcher.java | 18 ++ .../index/jpa/storage/AbstractStorage.java | 0 .../storage/JPADataIndexStorageService.java | 0 .../jpa/storage/JPADateTimeCoercing.java} | 10 +- .../kogito/index/jpa/storage/JPAQuery.java | 0 .../index/jpa/storage/JPAStorageService.java | 0 .../index/jpa/storage/JobEntityStorage.java | 0 .../ProcessDefinitionEntityStorage.java | 0 .../storage/ProcessInstanceEntityStorage.java | 0 .../UserTaskInstanceEntityStorage.java | 0 .../src/main/resources/META-INF/beans.xml | 0 .../mapper/AbstractJobEntityMapperIT.java} | 8 +- ...tractProcessDefinitionEntityMapperIT.java} | 8 +- ...bstractProcessInstanceEntityMapperIT.java} | 13 +- ...stractUserTaskInstanceEntityMapperIT.java} | 8 +- .../jpa/query/AbstractJobEntityQueryIT.java} | 10 +- ...stractProcessDefinitionEntityQueryIT.java} | 10 +- ...AbstractProcessInstanceEntityQueryIT.java} | 15 +- ...bstractUserTaskInstanceEntityQueryIT.java} | 10 +- .../jpa/storage/AbstractJobStorageIT.java} | 12 +- .../AbstractProcessDefinitionStorageIT.java} | 15 +- .../AbstractProcessInstanceStorageIT.java} | 10 +- .../index/jpa}/storage/AbstractStorageIT.java | 2 +- .../AbstractUserTaskInstanceStorageIT.java} | 24 +-- .../index/jpa}/storage/DomainQueryTest.java | 3 +- .../data-index-storage-jpa/pom.xml | 71 ++++++-- .../jdbc/JdbcStorageServiceProducer.java} | 6 +- .../index/jdbc}/JsonBinaryConverter.java | 2 +- .../src/main/resources/META-INF/orm.xml | 8 +- .../migration/V1.33.0__data_index_create.sql | 0 .../V1.44.0__data_index_definitions.sql | 0 ...V1.45.0.0__data_index_node_definitions.sql | 0 ....0.1__add_identity_to_process_instance.sql | 0 ....2__data_index_definitions_add_collums.sql | 0 .../index/jdbc/mapper/JobEntityMapperIT.java} | 9 +- .../ProcessDefinitionEntityMapperIT.java} | 9 +- .../ProcessInstanceEntityMapperIT.java} | 8 +- .../UserTaskInstanceEntityMapperIT.java} | 8 +- .../index/jdbc/query/JobEntityQueryIT.java | 31 ++++ .../query/ProcessDefinitionEntityQueryIT.java | 31 ++++ .../query/ProcessInstanceEntityQueryIT.java | 35 ++++ .../query/UserTaskInstanceEntityQueryIT.java | 31 ++++ .../index/jdbc/storage/JobStorageIT.java | 31 ++++ .../storage/ProcessDefinitionStorageIT.java | 31 ++++ .../storage/ProcessInstanceStorageIT.java | 30 ++++ .../storage/UserTaskInstanceStorageIT.java | 30 ++++ .../src/test/resources/application.properties | 8 +- .../src/main/resources/META-INF/beans.xml | 20 --- .../oracle/schema/DDLSchemaExporter.java | 81 --------- .../data-index-storage-postgresql/pom.xml | 9 +- .../postgresql/mapper/JobEntityMapperIT.java | 83 +-------- .../ProcessDefinitionEntityMapperIT.java | 82 +-------- .../mapper/ProcessInstanceEntityMapperIT.java | 163 +---------------- .../UserTaskInstanceEntityMapperIT.java | 145 +-------------- .../postgresql/query/JobEntityQueryIT.java | 18 +- .../query/ProcessDefinitionEntityQueryIT.java | 22 +-- .../query/ProcessInstanceEntityQueryIT.java | 21 +-- .../query/UserTaskInstanceEntityQueryIT.java | 20 +-- .../postgresql/storage/AbstractStorageIT.java | 59 ------ .../postgresql/storage/DomainQueryTest.java | 170 ------------------ .../postgresql/storage/JobStorageIT.java | 49 +---- .../storage/ProcessDefinitionStorageIT.java | 45 +---- .../storage/ProcessInstanceStorageIT.java | 28 +-- .../storage/UserTaskInstanceStorageIT.java | 29 +-- data-index/data-index-storage/pom.xml | 5 + .../containers/DataIndexOracleContainer.java | 44 ----- ...ataIndexOracleHttpQuarkusTestResource.java | 38 ---- .../http/DataIndexOracleHttpResource.java | 79 -------- .../kafka/DataIndexOracleKafkaResource.java | 92 ---------- ...taIndexOracleQuarkusKafkaTestResource.java | 41 ----- kogito-apps-bom/pom.xml | 27 ++- 119 files changed, 561 insertions(+), 2341 deletions(-) delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/AbstractProcessDataIndexOracleIT.java delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleHttpIT.java delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleKafkaIT.java delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/http/OracleHttpTestProfile.java delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/kafka/OracleKafkaTestProfile.java delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/ProcessDataIndexOracleIT.java delete mode 100644 apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/spring/DataIndexOracleSpringTestResource.java rename data-index/{data-index-graphql/src/main/java/org/kie/kogito/index/graphql => data-index-common/src/main/java/org/kie/kogito/index/api}/DateTimeCoercing.java (96%) rename data-index/{data-index-graphql/src/main/java/org/kie/kogito/index/graphql => data-index-common/src/main/java/org/kie/kogito/index/api}/DefaultDateTimeCoercing.java (98%) delete mode 100644 data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/PostgreSqlDateTimeCoercing.java delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/main/resources/application.properties delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/docker/docker-compose.yml delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/graphql/OracleDateTimeCoercingTest.java delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingLoadKafkaIT.java delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/InMemoryMessageTestProfile.java delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KafkaMessageTestProfile.java delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KeycloakTestProfile.java delete mode 100644 data-index/data-index-service/data-index-service-oracle/src/test/resources/application.properties delete mode 100644 data-index/data-index-service/data-index-service-postgresql/src/test/java/org/kie/kogito/index/service/graphql/PostgreSqlDateTimeCoercingTest.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa-common/pom.xml rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/mapper/JobEntityMapper.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessDefinitionEntityMapper.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessInstanceEntityMapper.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/mapper/UserTaskInstanceEntityMapper.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/AbstractEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/AttachmentEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/CommentEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/JobEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/JobEntityRepository.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntityId.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/NodeEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/NodeEntityId.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityId.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityRepository.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntityRepository.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceErrorEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntity.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntityRepository.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java (69%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/AbstractStorage.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/JPADataIndexStorageService.java (100%) rename data-index/{data-index-graphql/src/main/java/org/kie/kogito/index/graphql/OracleDateTimeCoercing.java => data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPADateTimeCoercing.java} (80%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/JPAQuery.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/JPAStorageService.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/JobEntityStorage.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/ProcessDefinitionEntityStorage.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java (100%) rename data-index/data-index-storage/{data-index-storage-jpa => data-index-storage-jpa-common}/src/main/java/org/kie/kogito/index/jpa/storage/UserTaskInstanceEntityStorage.java (100%) rename data-index/{data-index-service/data-index-service-oracle => data-index-storage/data-index-storage-jpa-common}/src/main/resources/META-INF/beans.xml (100%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/JobEntityMapperIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractJobEntityMapperIT.java} (95%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessDefinitionEntityMapperIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessDefinitionEntityMapperIT.java} (94%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessInstanceEntityMapperIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessInstanceEntityMapperIT.java} (96%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/UserTaskInstanceEntityMapperIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractUserTaskInstanceEntityMapperIT.java} (97%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/JobEntityQueryIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractJobEntityQueryIT.java} (77%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessDefinitionEntityQueryIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessDefinitionEntityQueryIT.java} (77%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessInstanceEntityQueryIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessInstanceEntityQueryIT.java} (71%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/UserTaskInstanceEntityQueryIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractUserTaskInstanceEntityQueryIT.java} (77%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/JobStorageIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractJobStorageIT.java} (85%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/ProcessDefinitionStorageIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessDefinitionStorageIT.java} (79%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/ProcessInstanceStorageIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessInstanceStorageIT.java} (84%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa}/storage/AbstractStorageIT.java (97%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/UserTaskInstanceStorageIT.java => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractUserTaskInstanceStorageIT.java} (68%) rename data-index/data-index-storage/{data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle => data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa}/storage/DomainQueryTest.java (98%) rename data-index/data-index-storage/{data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/OracleStorageServiceProducer.java => data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JdbcStorageServiceProducer.java} (95%) rename data-index/data-index-storage/{data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle => data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc}/JsonBinaryConverter.java (97%) rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/main/resources/META-INF/orm.xml (78%) rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/main/resources/db/migration/V1.33.0__data_index_create.sql (100%) rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/main/resources/db/migration/V1.44.0__data_index_definitions.sql (100%) rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/main/resources/db/migration/V1.45.0.0__data_index_node_definitions.sql (100%) rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/main/resources/db/migration/V1.45.0.1__add_identity_to_process_instance.sql (100%) rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/main/resources/db/migration/V1.45.0.2__data_index_definitions_add_collums.sql (100%) rename data-index/{data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingKafkaConsumerIT.java => data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/JobEntityMapperIT.java} (75%) rename data-index/{data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingHttpConsumerIT.java => data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessDefinitionEntityMapperIT.java} (75%) rename data-index/{data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/OracleIndexingServiceIT.java => data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessInstanceEntityMapperIT.java} (76%) rename data-index/{data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/KeycloakOracleIndexingServiceIT.java => data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/UserTaskInstanceEntityMapperIT.java} (75%) create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/JobEntityQueryIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessDefinitionEntityQueryIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessInstanceEntityQueryIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/UserTaskInstanceEntityQueryIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/JobStorageIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessDefinitionStorageIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessInstanceStorageIT.java create mode 100644 data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/UserTaskInstanceStorageIT.java rename data-index/data-index-storage/{data-index-storage-oracle => data-index-storage-jpa}/src/test/resources/application.properties (84%) delete mode 100644 data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/beans.xml delete mode 100644 data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java delete mode 100644 data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/AbstractStorageIT.java delete mode 100644 data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/DomainQueryTest.java delete mode 100644 data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/DataIndexOracleContainer.java delete mode 100644 data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpQuarkusTestResource.java delete mode 100644 data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpResource.java delete mode 100644 data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java delete mode 100644 data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleQuarkusKafkaTestResource.java diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/AbstractProcessDataIndexOracleIT.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/AbstractProcessDataIndexOracleIT.java deleted file mode 100644 index fd5d48fccd..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/AbstractProcessDataIndexOracleIT.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.oracle; - -import org.kie.kogito.index.AbstractProcessDataIndexIT; -import org.kie.kogito.test.quarkus.QuarkusTestProperty; - -import static org.kie.kogito.index.test.Constants.KOGITO_DATA_INDEX_SERVICE_URL; - -public abstract class AbstractProcessDataIndexOracleIT extends AbstractProcessDataIndexIT { - - @QuarkusTestProperty(name = KOGITO_DATA_INDEX_SERVICE_URL) - String dataIndex; - - @Override - public String getDataIndexURL() { - return dataIndex; - } - - @Override - public boolean validateDomainData() { - return false; - } -} diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleHttpIT.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleHttpIT.java deleted file mode 100644 index d323cbc6e0..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleHttpIT.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.oracle; - -import org.kie.kogito.index.quarkus.http.OracleHttpTestProfile; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.quarkus.test.junit.TestProfile; - -@QuarkusIntegrationTest -@TestProfile(OracleHttpTestProfile.class) -public class ProcessDataIndexOracleHttpIT extends AbstractProcessDataIndexOracleIT { -} diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleKafkaIT.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleKafkaIT.java deleted file mode 100644 index bfcd0a7486..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/oracle/ProcessDataIndexOracleKafkaIT.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.oracle; - -import org.kie.kogito.index.quarkus.kafka.OracleKafkaTestProfile; - -import io.quarkus.test.junit.QuarkusIntegrationTest; -import io.quarkus.test.junit.TestProfile; - -@QuarkusIntegrationTest -@TestProfile(OracleKafkaTestProfile.class) -public class ProcessDataIndexOracleKafkaIT extends AbstractProcessDataIndexOracleIT { -} diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/http/OracleHttpTestProfile.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/http/OracleHttpTestProfile.java deleted file mode 100644 index e8bc357953..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/http/OracleHttpTestProfile.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.quarkus.http; - -import java.util.Arrays; -import java.util.List; - -import org.kie.kogito.index.test.quarkus.http.DataIndexOracleHttpQuarkusTestResource; -import org.kie.kogito.index.test.quarkus.http.KogitoServiceRandomPortQuarkusHttpTestResource; - -import io.quarkus.test.junit.QuarkusTestProfile; - -public class OracleHttpTestProfile implements QuarkusTestProfile { - - @Override - public List testResources() { - return Arrays.asList(new TestResourceEntry(KogitoServiceRandomPortQuarkusHttpTestResource.class), - new TestResourceEntry(DataIndexOracleHttpQuarkusTestResource.class)); - } - -} diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/kafka/OracleKafkaTestProfile.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/kafka/OracleKafkaTestProfile.java deleted file mode 100644 index 4e129fb0f0..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-quarkus/src/test/java/org/kie/kogito/index/quarkus/kafka/OracleKafkaTestProfile.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.quarkus.kafka; - -import java.util.Arrays; -import java.util.List; - -import org.kie.kogito.index.test.quarkus.kafka.DataIndexOracleQuarkusKafkaTestResource; - -import io.quarkus.test.junit.QuarkusTestProfile; - -public class OracleKafkaTestProfile implements QuarkusTestProfile { - - @Override - public List testResources() { - return Arrays.asList(new TestResourceEntry(KogitoServiceRandomPortQuarkusKafkaTestResource.class), - new TestResourceEntry(DataIndexOracleQuarkusKafkaTestResource.class)); - } - -} diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/ProcessDataIndexOracleIT.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/ProcessDataIndexOracleIT.java deleted file mode 100644 index 9f9278ce26..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/ProcessDataIndexOracleIT.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index; - -import org.junit.jupiter.api.BeforeEach; -import org.kie.kogito.KogitoApplication; -import org.kie.kogito.index.spring.DataIndexOracleSpringTestResource; -import org.kie.kogito.index.spring.KogitoServiceRandomPortSpringTestResource; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.web.server.LocalServerPort; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; - -import io.restassured.RestAssured; - -import static org.kie.kogito.index.test.Constants.KOGITO_DATA_INDEX_SERVICE_URL; - -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = { KogitoApplication.class }) -@ContextConfiguration(initializers = { KogitoServiceRandomPortSpringTestResource.class, DataIndexOracleSpringTestResource.class }) -@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) -public class ProcessDataIndexOracleIT extends SpringBootAbstractProcessInstanceIT { - - @LocalServerPort - private int httpPort; - - @Value("${" + KOGITO_DATA_INDEX_SERVICE_URL + "}") - private String dataIndexUrl; - - @Override - public String getDataIndexURL() { - return dataIndexUrl; - } - - @Override - public boolean validateDomainData() { - return false; - } - - @BeforeEach - public void setup() { - RestAssured.port = httpPort; - } - -} diff --git a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/spring/DataIndexOracleSpringTestResource.java b/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/spring/DataIndexOracleSpringTestResource.java deleted file mode 100644 index fd8d1ef41c..0000000000 --- a/apps-integration-tests/integration-tests-data-index-service/integration-tests-data-index-service-springboot/src/test/java/org/kie/kogito/index/spring/DataIndexOracleSpringTestResource.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.spring; - -import java.util.HashMap; -import java.util.Map; - -import org.kie.kogito.index.test.quarkus.kafka.DataIndexOracleKafkaResource; -import org.kie.kogito.test.resources.ConditionalSpringBootTestResource; - -import static org.kie.kogito.index.test.Constants.KOGITO_DATA_INDEX_SERVICE_URL; - -public class DataIndexOracleSpringTestResource extends ConditionalSpringBootTestResource { - public DataIndexOracleSpringTestResource() { - super(new DataIndexOracleKafkaResource()); - } - - @Override - protected Map getProperties() { - Map properties = new HashMap<>(); - properties.put(KOGITO_DATA_INDEX_SERVICE_URL, "http://localhost:" + getTestResource().getMappedPort()); - properties.putAll(getTestResource().getProperties()); - return properties; - } - -} diff --git a/data-index/data-index-common/pom.xml b/data-index/data-index-common/pom.xml index bca376617f..ec7bf7d92f 100644 --- a/data-index/data-index-common/pom.xml +++ b/data-index/data-index-common/pom.xml @@ -45,6 +45,10 @@ org.kie.kogito kogito-events-core + + com.graphql-java + graphql-java + io.quarkus quarkus-jackson diff --git a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/DateTimeCoercing.java b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/DateTimeCoercing.java similarity index 96% rename from data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/DateTimeCoercing.java rename to data-index/data-index-common/src/main/java/org/kie/kogito/index/api/DateTimeCoercing.java index 3b72407932..621bf6d716 100644 --- a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/DateTimeCoercing.java +++ b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/DateTimeCoercing.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.graphql; +package org.kie.kogito.index.api; import graphql.schema.Coercing; diff --git a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercing.java b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/DefaultDateTimeCoercing.java similarity index 98% rename from data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercing.java rename to data-index/data-index-common/src/main/java/org/kie/kogito/index/api/DefaultDateTimeCoercing.java index 9bdde6dce1..95fba82147 100644 --- a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercing.java +++ b/data-index/data-index-common/src/main/java/org/kie/kogito/index/api/DefaultDateTimeCoercing.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.graphql; +package org.kie.kogito.index.api; import java.time.DateTimeException; import java.time.Instant; diff --git a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLScalarTypeProducer.java b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLScalarTypeProducer.java index 84f5744804..e84698c831 100644 --- a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLScalarTypeProducer.java +++ b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/GraphQLScalarTypeProducer.java @@ -18,6 +18,8 @@ */ package org.kie.kogito.index.graphql; +import org.kie.kogito.index.api.DateTimeCoercing; + import graphql.schema.GraphQLScalarType; import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.inject.Produces; diff --git a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/PostgreSqlDateTimeCoercing.java b/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/PostgreSqlDateTimeCoercing.java deleted file mode 100644 index e4001bb797..0000000000 --- a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/PostgreSqlDateTimeCoercing.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.graphql; - -import java.time.ZonedDateTime; - -import io.quarkus.arc.properties.IfBuildProperty; - -import graphql.language.StringValue; -import jakarta.enterprise.context.ApplicationScoped; - -import static org.kie.kogito.persistence.api.factory.Constants.PERSISTENCE_TYPE_PROPERTY; - -@ApplicationScoped -@IfBuildProperty(name = PERSISTENCE_TYPE_PROPERTY, stringValue = "postgresql") -public class PostgreSqlDateTimeCoercing extends DefaultDateTimeCoercing implements DateTimeCoercing { - - @Override - public Object parseValue(Object input) { - return input == null ? null : getZonedDateTime((String) input); - } - - private ZonedDateTime getZonedDateTime(String input) { - return parseDateTime(input); - } - - @Override - public Object parseLiteral(Object input) { - if (input instanceof StringValue) { - return getZonedDateTime(((StringValue) input).getValue()); - } else { - return null; - } - } -} diff --git a/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DateTimeScalarTypeProducerTest.java b/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DateTimeScalarTypeProducerTest.java index 224e45fce3..4558cffd97 100644 --- a/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DateTimeScalarTypeProducerTest.java +++ b/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DateTimeScalarTypeProducerTest.java @@ -19,6 +19,7 @@ package org.kie.kogito.index.graphql; import org.junit.jupiter.api.Test; +import org.kie.kogito.index.api.DefaultDateTimeCoercing; import graphql.schema.GraphQLScalarType; diff --git a/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercingTest.java b/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercingTest.java index 46aa657512..0f60f439e9 100644 --- a/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercingTest.java +++ b/data-index/data-index-graphql/src/test/java/org/kie/kogito/index/graphql/DefaultDateTimeCoercingTest.java @@ -25,6 +25,7 @@ import java.time.temporal.ChronoUnit; import org.junit.jupiter.api.Test; +import org.kie.kogito.index.api.DefaultDateTimeCoercing; import graphql.language.StringValue; import graphql.schema.CoercingSerializeException; diff --git a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/GraphQLQueryMapperTest.java b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/GraphQLQueryMapperTest.java index ebcca023fd..6caec6c860 100644 --- a/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/GraphQLQueryMapperTest.java +++ b/data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/query/GraphQLQueryMapperTest.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import org.kie.kogito.index.graphql.DefaultDateTimeCoercing; +import org.kie.kogito.index.api.DefaultDateTimeCoercing; import org.kie.kogito.index.graphql.GraphQLScalarTypeProducer; import org.kie.kogito.index.graphql.query.GraphQLQueryParser; import org.kie.kogito.index.graphql.query.GraphQLQueryParserRegistry; diff --git a/data-index/data-index-service/data-index-service-oracle/src/main/resources/application.properties b/data-index/data-index-service/data-index-service-oracle/src/main/resources/application.properties deleted file mode 100644 index 6ee6ffb0cd..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/main/resources/application.properties +++ /dev/null @@ -1,39 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -#Data Index -kogito.apps.persistence.type=oracle -kogito.data-index.domain-indexing=false -kogito.data-index.blocking=true - -#Kafka -quarkus.kafka.health.enabled=true - -quarkus.datasource.db-kind=oracle - -#Hibernate -quarkus.hibernate-orm.jdbc.timezone=UTC -quarkus.hibernate-orm.physical-naming-strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy -# Normalizing timezones storage as Hibernate ORM 5 for backwards compatibility. -quarkus.hibernate-orm.mapping.timezone.default-storage=normalize - -#Container image -quarkus.container-image.build=${quarkus.build.image:true} -quarkus.container-image.group=org.kie.kogito -quarkus.jib.jvm-arguments=-Dquarkus.http.port=8080 diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/docker/docker-compose.yml b/data-index/data-index-service/data-index-service-oracle/src/test/docker/docker-compose.yml deleted file mode 100644 index 25578f35ed..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/docker/docker-compose.yml +++ /dev/null @@ -1,71 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -version: "3" - -networks: - default: - driver: bridge - enable_ipv6: false - ipam: - config: - - subnet: 172.16.57.0/24 - -services: - zookeeper: - image: strimzi/kafka:0.20.1-kafka-2.6.0 - container_name: data-index-zookeeper - command: [ - "sh", "-c", - "bin/zookeeper-server-start.sh config/zookeeper.properties" - ] - ports: - - "2181:2181" - environment: - LOG_DIR: "/tmp/logs" - - kafka: - image: strimzi/kafka:0.20.1-kafka-2.6.0 - container_name: data-index-kafka - command: [ - "sh", "-c", - "bin/kafka-server-start.sh config/server.properties --override inter.broker.listener.name=$${KAFKA_INTER_BROKER_LISTENER_NAME} --override listener.security.protocol.map=$${KAFKA_LISTENER_SECURITY_PROTOCOL_MAP} --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}" - ] - depends_on: - - zookeeper - ports: - - "9092:9092" - environment: - KAFKA_BROKER_ID: 0 - KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 - KAFKA_LISTENERS: INTERNAL://kafka:29092,EXTERNAL://kafka:9092 - KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:29092,EXTERNAL://localhost:9092 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT - KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL - KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" - KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 - LOG_DIR: "/tmp/logs" - - oracle: - image: gvenzl/oracle-xe:21.3.0-slim - container_name: data-index-oracle - environment: - ORACLE_PASSWORD: test - ports: - - 1521:1521 diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/graphql/OracleDateTimeCoercingTest.java b/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/graphql/OracleDateTimeCoercingTest.java deleted file mode 100644 index 92148ad792..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/graphql/OracleDateTimeCoercingTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.service.graphql; - -import java.time.ZonedDateTime; - -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.graphql.OracleDateTimeCoercing; - -import graphql.language.StringValue; -import graphql.schema.CoercingSerializeException; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; - -public class OracleDateTimeCoercingTest { - - OracleDateTimeCoercing dateTimeCoercing = new OracleDateTimeCoercing(); - - @Test - public void testParseValueAsZonedDateTime() { - assertThat(dateTimeCoercing.parseValue(null)).isNull(); - assertThat(dateTimeCoercing.parseValue("2019-11-20T03:14:03.075Z")) - .isEqualTo(ZonedDateTime.parse("2019-11-20T03:14:03.075Z")); - } - - @Test - public void testParseLiteral() { - assertThat(dateTimeCoercing.parseLiteral(null)).isNull(); - assertThat(dateTimeCoercing.parseLiteral(new StringValue("2019-11-20T03:14:03.075Z"))) - .isEqualTo(ZonedDateTime.parse("2019-11-20T03:14:03.075Z")); - } - - @Test - public void testSerializeInvalidString() { - try { - dateTimeCoercing.serialize("test"); - fail("Method should throw CoercingSerializeException"); - } catch (CoercingSerializeException ex) { - assertThat(ex.getMessage()) - .isEqualTo("Invalid ISO-8601 value : 'test'. because of : 'Text 'test' could not be parsed at index 0'"); - } - } - - @Test - public void testSerializeNull() { - try { - dateTimeCoercing.serialize(null); - fail("Method should throw CoercingSerializeException"); - } catch (CoercingSerializeException ex) { - assertThat(ex.getMessage()) - .isEqualTo("Expected something we can convert to 'java.time.ZonedDateTime' but was 'null'."); - } - } - - @Test - public void testSerializeInvalidType() { - try { - dateTimeCoercing.serialize(1); - fail("Method should throw CoercingSerializeException"); - } catch (CoercingSerializeException ex) { - assertThat(ex.getMessage()) - .isEqualTo("Expected something we can convert to 'java.time.ZonedDateTime' but was 'java.lang.Integer'."); - } - } - - @Test - public void testSerializeString() { - String result = dateTimeCoercing.serialize("2019-08-20T19:26:02.092+00:00"); - assertThat(result).isEqualTo("2019-08-20T19:26:02.092Z"); - } - -} diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingLoadKafkaIT.java b/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingLoadKafkaIT.java deleted file mode 100644 index c36e54f125..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingLoadKafkaIT.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.service.messaging; - -import org.junit.jupiter.api.Disabled; -import org.kie.kogito.index.service.test.KafkaMessageTestProfile; - -import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; - -@QuarkusTest -@TestProfile(KafkaMessageTestProfile.class) -@Disabled -class OracleMessagingLoadKafkaIT extends AbstractMessagingLoadKafkaIT { - -} diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/InMemoryMessageTestProfile.java b/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/InMemoryMessageTestProfile.java deleted file mode 100644 index 27bfc31fb6..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/InMemoryMessageTestProfile.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.service.test; - -import java.util.Arrays; -import java.util.List; - -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.junit.QuarkusTestProfile; - -public class InMemoryMessageTestProfile implements QuarkusTestProfile { - - @Override - public List testResources() { - return Arrays.asList( - new TestResourceEntry(InMemoryMessagingTestResource.class), - new TestResourceEntry(OracleSqlQuarkusTestResource.class)); - } -} diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KafkaMessageTestProfile.java b/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KafkaMessageTestProfile.java deleted file mode 100644 index babcab6b20..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KafkaMessageTestProfile.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.service.test; - -import java.util.Arrays; -import java.util.List; - -import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.junit.QuarkusTestProfile; - -public class KafkaMessageTestProfile implements QuarkusTestProfile { - - @Override - public List testResources() { - return Arrays.asList( - new TestResourceEntry(OracleSqlQuarkusTestResource.class), - new TestResourceEntry(KafkaQuarkusTestResource.class)); - } - - @Override - public String getConfigProfile() { - return "kafka-events-support"; - } -} diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KeycloakTestProfile.java b/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KeycloakTestProfile.java deleted file mode 100644 index f171568214..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/test/KeycloakTestProfile.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.service.test; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.junit.QuarkusTestProfile; - -import static java.util.Collections.singletonMap; -import static org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource.KOGITO_OIDC_TENANTS; - -public class KeycloakTestProfile implements QuarkusTestProfile { - - @Override - public Map getConfigOverrides() { - Map config = new HashMap<>(); - config.put("quarkus.http.auth.policy.role-policy1.roles-allowed", "confidential"); - config.put("quarkus.http.auth.permission.roles1.paths", "/*"); - config.put("quarkus.http.auth.permission.roles1.policy", "role-policy1"); - return config; - } - - @Override - public String getConfigProfile() { - return "keycloak-test"; - } - - @Override - public List testResources() { - Map args = singletonMap(KOGITO_OIDC_TENANTS, "web-app-tenant"); - return Arrays.asList( - new TestResourceEntry(OracleSqlQuarkusTestResource.class), - new TestResourceEntry(InMemoryMessagingTestResource.class), - new TestResourceEntry(KeycloakQuarkusTestResource.class, args)); - } - -} diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/resources/application.properties b/data-index/data-index-service/data-index-service-oracle/src/test/resources/application.properties deleted file mode 100644 index 1e250e5239..0000000000 --- a/data-index/data-index-service/data-index-service-oracle/src/test/resources/application.properties +++ /dev/null @@ -1,63 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -#Data Index -kogito.apps.persistence.type=oracle -kogito.data-index.domain-indexing=false -kogito.data-index.blocking=true -kogito.data-index.vertx-graphql.ui.path=/graphiql -kogito.data-index.vertx-graphql.ui.tenant=web-app-tenant - -#Flyway -quarkus.flyway.migrate-at-start=true -quarkus.flyway.baseline-on-migrate=true - -# Kafka -kafka.bootstrap.servers=localhost:9092 -# Persistence -quarkus.datasource.db-kind=oracle -quarkus.datasource.username=test -quarkus.datasource.password=test -quarkus.datasource.jdbc.url=jdbc:oracle://localhost:1521/XEPDB1 - -#Hibernate -quarkus.hibernate-orm.jdbc.timezone=UTC -quarkus.hibernate-orm.database.generation.halt-on-error=true -quarkus.hibernate-orm.physical-naming-strategy=org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy - -# Security -quarkus.oidc.enabled=false -quarkus.oidc.tenant-enabled=false -quarkus.oidc.auth-server-url=none - -# Keycloak oidc -%keycloak-test.quarkus.oidc.enabled=true -%keycloak-test.quarkus.oidc.tenant-enabled=true -#%keycloak-test.quarkus.oidc.auth-server-url=http://localhost:8281/auth/realms/kogito -%keycloak-test.quarkus.oidc.client-id=kogito-app -%keycloak-test.quarkus.oidc.credentials.secret=secret -%keycloak-test.quarkus.oidc.application-type=service - -#%keycloak-test.quarkus.oidc.web-app-tenant.auth-server-url=http://localhost:8281/auth/realms/kogito -%keycloak-test.quarkus.oidc.web-app-tenant.client-id=kogito-app -%keycloak-test.quarkus.oidc.web-app-tenant.credentials.secret=secret -%keycloak-test.quarkus.oidc.web-app-tenant.application-type=web-app - -# Not using Dev service in test, but rather org.kie.kogito.testcontainers.quarkus.KeycloakQuarkusTestResource -quarkus.keycloak.devservices.enabled=false diff --git a/data-index/data-index-service/data-index-service-postgresql/src/test/java/org/kie/kogito/index/service/graphql/PostgreSqlDateTimeCoercingTest.java b/data-index/data-index-service/data-index-service-postgresql/src/test/java/org/kie/kogito/index/service/graphql/PostgreSqlDateTimeCoercingTest.java deleted file mode 100644 index 9ac63e7352..0000000000 --- a/data-index/data-index-service/data-index-service-postgresql/src/test/java/org/kie/kogito/index/service/graphql/PostgreSqlDateTimeCoercingTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.service.graphql; - -import java.time.ZonedDateTime; - -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.graphql.PostgreSqlDateTimeCoercing; - -import graphql.language.StringValue; -import graphql.schema.CoercingSerializeException; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.fail; - -public class PostgreSqlDateTimeCoercingTest { - - PostgreSqlDateTimeCoercing dateTimeCoercing = new PostgreSqlDateTimeCoercing(); - - @Test - public void testParseValueAsZonedDateTime() { - assertThat(dateTimeCoercing.parseValue(null)).isNull(); - assertThat(dateTimeCoercing.parseValue("2019-11-20T03:14:03.075Z")) - .isEqualTo(ZonedDateTime.parse("2019-11-20T03:14:03.075Z")); - } - - @Test - public void testParseLiteral() { - assertThat(dateTimeCoercing.parseLiteral(null)).isNull(); - assertThat(dateTimeCoercing.parseLiteral(new StringValue("2019-11-20T03:14:03.075Z"))) - .isEqualTo(ZonedDateTime.parse("2019-11-20T03:14:03.075Z")); - } - - @Test - public void testSerializeInvalidString() { - try { - dateTimeCoercing.serialize("test"); - fail("Method should throw CoercingSerializeException"); - } catch (CoercingSerializeException ex) { - assertThat(ex.getMessage()) - .isEqualTo("Invalid ISO-8601 value : 'test'. because of : 'Text 'test' could not be parsed at index 0'"); - } - } - - @Test - public void testSerializeNull() { - try { - dateTimeCoercing.serialize(null); - fail("Method should throw CoercingSerializeException"); - } catch (CoercingSerializeException ex) { - assertThat(ex.getMessage()) - .isEqualTo("Expected something we can convert to 'java.time.ZonedDateTime' but was 'null'."); - } - } - - @Test - public void testSerializeInvalidType() { - try { - dateTimeCoercing.serialize(1); - fail("Method should throw CoercingSerializeException"); - } catch (CoercingSerializeException ex) { - assertThat(ex.getMessage()) - .isEqualTo("Expected something we can convert to 'java.time.ZonedDateTime' but was 'java.lang.Integer'."); - } - } - - @Test - public void testSerializeString() { - String result = dateTimeCoercing.serialize("2019-08-20T19:26:02.092+00:00"); - assertThat(result).isEqualTo("2019-08-20T19:26:02.092Z"); - } - -} diff --git a/data-index/data-index-service/pom.xml b/data-index/data-index-service/pom.xml index 23283ff121..fe242f2029 100644 --- a/data-index/data-index-service/pom.xml +++ b/data-index/data-index-service/pom.xml @@ -35,6 +35,11 @@ data-index-service-common data-index-service-inmemory data-index-service-postgresql +<<<<<<< 9.99.x-prod +======= + data-index-service-infinispan + data-index-service-mongodb +>>>>>>> b6ece5b Removing oracle driver and associated tests (#1971) diff --git a/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml b/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml new file mode 100644 index 0000000000..d9d262ac0f --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml @@ -0,0 +1,113 @@ + + + + + org.kie.kogito + data-index-storage + 999-SNAPSHOT + + 4.0.0 + + data-index-storage-jpa-common + Kogito Apps :: Data Index Storage JPA common classes + + + org.kie.kogito.index.jpa.common + + + + + + org.kie.kogito + data-index-storage-api + + + org.kie.kogito + data-index-common + + + org.kie.kogito + persistence-commons-jpa + + + org.mapstruct + mapstruct + + + org.kie.kogito + data-index-storage-api + test-jar + test + + + io.quarkus + quarkus-junit5-mockito + test + + + org.assertj + assertj-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.kie.kogito + kogito-quarkus-test-utils + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.mapstruct + mapstruct-processor + ${version.org.mapstruct} + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + \ No newline at end of file diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/JobEntityMapper.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/JobEntityMapper.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/JobEntityMapper.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/JobEntityMapper.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessDefinitionEntityMapper.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessDefinitionEntityMapper.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessDefinitionEntityMapper.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessDefinitionEntityMapper.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessInstanceEntityMapper.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessInstanceEntityMapper.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessInstanceEntityMapper.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/ProcessInstanceEntityMapper.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/UserTaskInstanceEntityMapper.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/UserTaskInstanceEntityMapper.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/mapper/UserTaskInstanceEntityMapper.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/mapper/UserTaskInstanceEntityMapper.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/AbstractEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/AbstractEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/AbstractEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/AbstractEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/AttachmentEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/AttachmentEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/AttachmentEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/AttachmentEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/CommentEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/CommentEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/CommentEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/CommentEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/JobEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/JobEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/JobEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/JobEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/JobEntityRepository.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/JobEntityRepository.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/JobEntityRepository.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/JobEntityRepository.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntityId.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntityId.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntityId.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/MilestoneEntityId.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/NodeEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/NodeEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/NodeEntityId.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeEntityId.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/NodeEntityId.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeEntityId.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/NodeInstanceEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityId.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityId.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityId.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityId.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityRepository.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityRepository.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityRepository.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessDefinitionEntityRepository.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntityRepository.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntityRepository.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntityRepository.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceEntityRepository.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceErrorEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceErrorEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceErrorEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/ProcessInstanceErrorEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntity.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntity.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntity.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntity.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntityRepository.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntityRepository.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntityRepository.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/model/UserTaskInstanceEntityRepository.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java similarity index 69% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java index 881b7eb516..a87c7f8eb1 100644 --- a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/AbstractJPAStorageFetcher.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.kie.kogito.index.jpa.storage; import java.util.function.Function; diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/AbstractStorage.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/AbstractStorage.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/AbstractStorage.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/AbstractStorage.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JPADataIndexStorageService.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPADataIndexStorageService.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JPADataIndexStorageService.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPADataIndexStorageService.java diff --git a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/OracleDateTimeCoercing.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPADateTimeCoercing.java similarity index 80% rename from data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/OracleDateTimeCoercing.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPADateTimeCoercing.java index 1c604cae29..6ac9ef2dd4 100644 --- a/data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/OracleDateTimeCoercing.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPADateTimeCoercing.java @@ -16,20 +16,18 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.graphql; +package org.kie.kogito.index.jpa.storage; import java.time.ZonedDateTime; -import io.quarkus.arc.properties.IfBuildProperty; +import org.kie.kogito.index.api.DateTimeCoercing; +import org.kie.kogito.index.api.DefaultDateTimeCoercing; import graphql.language.StringValue; import jakarta.enterprise.context.ApplicationScoped; -import static org.kie.kogito.persistence.api.factory.Constants.PERSISTENCE_TYPE_PROPERTY; - @ApplicationScoped -@IfBuildProperty(name = PERSISTENCE_TYPE_PROPERTY, stringValue = "oracle") -public class OracleDateTimeCoercing extends DefaultDateTimeCoercing implements DateTimeCoercing { +public class JPADateTimeCoercing extends DefaultDateTimeCoercing implements DateTimeCoercing { @Override public Object parseValue(Object input) { diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JPAQuery.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPAQuery.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JPAQuery.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPAQuery.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JPAStorageService.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPAStorageService.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JPAStorageService.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JPAStorageService.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JobEntityStorage.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JobEntityStorage.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/JobEntityStorage.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/JobEntityStorage.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/ProcessDefinitionEntityStorage.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessDefinitionEntityStorage.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/ProcessDefinitionEntityStorage.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessDefinitionEntityStorage.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/ProcessInstanceEntityStorage.java diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/UserTaskInstanceEntityStorage.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/UserTaskInstanceEntityStorage.java similarity index 100% rename from data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jpa/storage/UserTaskInstanceEntityStorage.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/java/org/kie/kogito/index/jpa/storage/UserTaskInstanceEntityStorage.java diff --git a/data-index/data-index-service/data-index-service-oracle/src/main/resources/META-INF/beans.xml b/data-index/data-index-storage/data-index-storage-jpa-common/src/main/resources/META-INF/beans.xml similarity index 100% rename from data-index/data-index-service/data-index-service-oracle/src/main/resources/META-INF/beans.xml rename to data-index/data-index-storage/data-index-storage-jpa-common/src/main/resources/META-INF/beans.xml diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/JobEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractJobEntityMapperIT.java similarity index 95% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/JobEntityMapperIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractJobEntityMapperIT.java index a7504f914f..dd8477855d 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/JobEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractJobEntityMapperIT.java @@ -16,24 +16,20 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.mapper; +package org.kie.kogito.index.jpa.mapper; import java.time.ZonedDateTime; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.JobEntityMapper; import org.kie.kogito.index.jpa.model.JobEntity; import org.kie.kogito.index.model.Job; -import io.quarkus.test.junit.QuarkusTest; - import jakarta.inject.Inject; import static org.assertj.core.api.Assertions.assertThat; -@QuarkusTest -class JobEntityMapperIT { +public abstract class AbstractJobEntityMapperIT { @Inject JobEntityMapper mapper; diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessDefinitionEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessDefinitionEntityMapperIT.java similarity index 94% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessDefinitionEntityMapperIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessDefinitionEntityMapperIT.java index 4369de3058..3df75e17bf 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessDefinitionEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessDefinitionEntityMapperIT.java @@ -16,20 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.mapper; +package org.kie.kogito.index.jpa.mapper; import java.util.Set; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.ProcessDefinitionEntityMapper; import org.kie.kogito.index.jpa.model.NodeEntity; import org.kie.kogito.index.jpa.model.ProcessDefinitionEntity; import org.kie.kogito.index.model.Node; import org.kie.kogito.index.model.ProcessDefinition; -import io.quarkus.test.junit.QuarkusTest; - import jakarta.inject.Inject; import static java.util.Collections.singleton; @@ -37,8 +34,7 @@ import static java.util.Collections.singletonMap; import static org.assertj.core.api.Assertions.assertThat; -@QuarkusTest -class ProcessDefinitionEntityMapperIT { +public abstract class AbstractProcessDefinitionEntityMapperIT { ProcessDefinition pd = new ProcessDefinition(); ProcessDefinitionEntity entity = new ProcessDefinitionEntity(); diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessInstanceEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessInstanceEntityMapperIT.java similarity index 96% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessInstanceEntityMapperIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessInstanceEntityMapperIT.java index 95840d7e1a..1bb4b5a64f 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/ProcessInstanceEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractProcessInstanceEntityMapperIT.java @@ -16,14 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.mapper; +package org.kie.kogito.index.jpa.mapper; import java.time.ZonedDateTime; import java.util.Set; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.ProcessInstanceEntityMapper; import org.kie.kogito.index.jpa.model.MilestoneEntity; import org.kie.kogito.index.jpa.model.MilestoneEntityId; import org.kie.kogito.index.jpa.model.NodeInstanceEntity; @@ -37,16 +36,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.quarkus.test.junit.QuarkusTest; - import jakarta.inject.Inject; import static java.util.Collections.singleton; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; -@QuarkusTest -class ProcessInstanceEntityMapperIT { +public abstract class AbstractProcessInstanceEntityMapperIT { ObjectMapper jsonMapper = new ObjectMapper(); ProcessInstance processInstance = new ProcessInstance(); @@ -72,7 +68,6 @@ void setup() { String testId = "testId"; String processId = "testProcessId"; - String version = "1.0"; Set roles = singleton("testRoles"); ObjectNode variables = jsonMapper.createObjectNode(); variables.put("test", "testValue"); @@ -108,7 +103,6 @@ void setup() { processInstance.setId(testId); processInstance.setProcessId(processId); - processInstance.setVersion(version); processInstance.setRoles(roles); processInstance.setVariables(variables); processInstance.setEndpoint(endpoint); @@ -153,7 +147,6 @@ void setup() { processInstanceEntity.setId(testId); processInstanceEntity.setProcessId(processId); - processInstanceEntity.setVersion(version); processInstanceEntity.setRoles(roles); processInstanceEntity.setVariables(variables); processInstanceEntity.setEndpoint(endpoint); @@ -169,9 +162,9 @@ void setup() { processInstanceEntity.setAddons(addons); processInstanceEntity.setLastUpdate(time); processInstanceEntity.setBusinessKey(businessKey); + processInstanceEntity.setMilestones(singletonList(milestoneEntity)); processInstanceEntity.setCreatedBy(createdBy); processInstanceEntity.setUpdatedBy(updatedBy); - processInstanceEntity.setMilestones(singletonList(milestoneEntity)); } @Test diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/UserTaskInstanceEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractUserTaskInstanceEntityMapperIT.java similarity index 97% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/UserTaskInstanceEntityMapperIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractUserTaskInstanceEntityMapperIT.java index 167da216df..6d4dd31e24 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/mapper/UserTaskInstanceEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/mapper/AbstractUserTaskInstanceEntityMapperIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.mapper; +package org.kie.kogito.index.jpa.mapper; import java.time.ZonedDateTime; import java.util.HashMap; @@ -25,7 +25,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.UserTaskInstanceEntityMapper; import org.kie.kogito.index.jpa.model.AttachmentEntity; import org.kie.kogito.index.jpa.model.CommentEntity; import org.kie.kogito.index.jpa.model.UserTaskInstanceEntity; @@ -36,16 +35,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; -import io.quarkus.test.junit.QuarkusTest; - import jakarta.inject.Inject; import static java.util.Collections.singleton; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; -@QuarkusTest -class UserTaskInstanceEntityMapperIT { +public abstract class AbstractUserTaskInstanceEntityMapperIT { UserTaskInstance userTaskInstance = new UserTaskInstance(); UserTaskInstanceEntity userTaskInstanceEntity = new UserTaskInstanceEntity(); diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/JobEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractJobEntityQueryIT.java similarity index 77% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/JobEntityQueryIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractJobEntityQueryIT.java index fe12f79d1d..f07b11b5dd 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/JobEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractJobEntityQueryIT.java @@ -16,22 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.query; +package org.kie.kogito.index.jpa.query; import org.kie.kogito.index.jpa.storage.JobEntityStorage; import org.kie.kogito.index.model.Job; import org.kie.kogito.index.test.query.AbstractJobQueryIT; import org.kie.kogito.persistence.api.Storage; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; -@QuarkusTest -@QuarkusTestResource(OracleSqlQuarkusTestResource.class) -class JobEntityQueryIT extends AbstractJobQueryIT { +public abstract class AbstractJobEntityQueryIT extends AbstractJobQueryIT { @Inject JobEntityStorage storage; diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessDefinitionEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessDefinitionEntityQueryIT.java similarity index 77% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessDefinitionEntityQueryIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessDefinitionEntityQueryIT.java index f5ab610f09..0eab6d2d8f 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessDefinitionEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessDefinitionEntityQueryIT.java @@ -16,22 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.query; +package org.kie.kogito.index.jpa.query; import org.kie.kogito.index.jpa.storage.ProcessDefinitionEntityStorage; import org.kie.kogito.index.model.ProcessDefinition; import org.kie.kogito.index.test.query.AbstractProcessDefinitionQueryIT; import org.kie.kogito.persistence.api.Storage; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; -@QuarkusTest -@QuarkusTestResource(OracleSqlQuarkusTestResource.class) -class ProcessDefinitionEntityQueryIT extends AbstractProcessDefinitionQueryIT { +public abstract class AbstractProcessDefinitionEntityQueryIT extends AbstractProcessDefinitionQueryIT { @Inject ProcessDefinitionEntityStorage storage; diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessInstanceEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessInstanceEntityQueryIT.java similarity index 71% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessInstanceEntityQueryIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessInstanceEntityQueryIT.java index 88e898e9c8..f2fc967907 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/ProcessInstanceEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractProcessInstanceEntityQueryIT.java @@ -16,20 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.query; +package org.kie.kogito.index.jpa.query; import org.kie.kogito.index.jpa.storage.ProcessInstanceEntityStorage; import org.kie.kogito.index.test.query.AbstractProcessInstanceQueryIT; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; -@QuarkusTest -@QuarkusTestResource(OracleSqlQuarkusTestResource.class) -class ProcessInstanceEntityQueryIT extends AbstractProcessInstanceQueryIT { +public abstract class AbstractProcessInstanceEntityQueryIT extends AbstractProcessInstanceQueryIT { @Inject ProcessInstanceEntityStorage storage; @@ -38,9 +32,4 @@ class ProcessInstanceEntityQueryIT extends AbstractProcessInstanceQueryIT { public ProcessInstanceEntityStorage getStorage() { return storage; } - - @Override - protected Boolean isDateTimeAsLong() { - return false; - } } diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/UserTaskInstanceEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractUserTaskInstanceEntityQueryIT.java similarity index 77% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/UserTaskInstanceEntityQueryIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractUserTaskInstanceEntityQueryIT.java index 522bd54ad2..347b2765c9 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/query/UserTaskInstanceEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/query/AbstractUserTaskInstanceEntityQueryIT.java @@ -16,20 +16,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.query; +package org.kie.kogito.index.jpa.query; import org.kie.kogito.index.jpa.storage.UserTaskInstanceEntityStorage; import org.kie.kogito.index.test.query.AbstractUserTaskInstanceQueryIT; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; -@QuarkusTest -@QuarkusTestResource(OracleSqlQuarkusTestResource.class) -class UserTaskInstanceEntityQueryIT extends AbstractUserTaskInstanceQueryIT { +public abstract class AbstractUserTaskInstanceEntityQueryIT extends AbstractUserTaskInstanceQueryIT { @Inject UserTaskInstanceEntityStorage storage; diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/JobStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractJobStorageIT.java similarity index 85% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/JobStorageIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractJobStorageIT.java index a602ad8c45..75ea7aeb08 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/JobStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractJobStorageIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.storage; +package org.kie.kogito.index.jpa.storage; import java.util.UUID; @@ -27,16 +27,10 @@ import org.kie.kogito.index.model.Job; import org.kie.kogito.index.test.TestUtils; import org.kie.kogito.persistence.api.StorageService; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; -@QuarkusTest -@QuarkusTestResource(OracleSqlQuarkusTestResource.class) -public class JobStorageIT extends AbstractStorageIT { +public abstract class AbstractJobStorageIT extends AbstractStorageIT { @Inject JobEntityRepository repository; @@ -44,7 +38,7 @@ public class JobStorageIT extends AbstractStorageIT { @Inject StorageService storage; - public JobStorageIT() { + public AbstractJobStorageIT() { super(Job.class); } diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/ProcessDefinitionStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessDefinitionStorageIT.java similarity index 79% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/ProcessDefinitionStorageIT.java rename to data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessDefinitionStorageIT.java index 7d915b5fed..5cbd6db8cc 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/storage/ProcessDefinitionStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa-common/src/test/java/org/kie/kogito/index/jpa/storage/AbstractProcessDefinitionStorageIT.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle.storage; +package org.kie.kogito.index.jpa.storage; import java.util.Set; @@ -24,20 +24,13 @@ import org.junit.jupiter.api.Test; import org.kie.kogito.index.jpa.model.ProcessDefinitionEntity; import org.kie.kogito.index.jpa.model.ProcessDefinitionEntityRepository; -import org.kie.kogito.index.jpa.storage.ProcessDefinitionEntityStorage; import org.kie.kogito.index.model.ProcessDefinition; import org.kie.kogito.index.test.TestUtils; import org.kie.kogito.persistence.api.StorageService; -import org.kie.kogito.testcontainers.quarkus.OracleSqlQuarkusTestResource; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; import jakarta.inject.Inject; -@QuarkusTest -@QuarkusTestResource(OracleSqlQuarkusTestResource.class) -class ProcessDefinitionStorageIT extends AbstractStorageIT { +public abstract class AbstractProcessDefinitionStorageIT extends AbstractStorageIT { @Inject ProcessDefinitionEntityRepository repository; @@ -45,7 +38,7 @@ class ProcessDefinitionStorageIT extends AbstractStorageIT4.0.0 data-index-storage-jpa - Kogito Apps :: Data Index Storage JPA + Kogito Apps :: Data Index Storage JPA compatible DBs org.kie.kogito.index.jpa - + org.kie.kogito - data-index-storage-api + data-index-storage-jpa-common + + + io.quarkus + quarkus-test-h2 + test - org.kie.kogito - data-index-common + io.quarkus + quarkus-jdbc-h2 org.kie.kogito - persistence-commons-jpa + data-index-storage-api + test-jar + test + ${project.version} + + + org.kie.kogito + data-index-storage-jpa-common + test-jar + test + ${project.version} + + + io.quarkus + quarkus-junit5-mockito + test - org.mapstruct - mapstruct + org.assertj + assertj-core + test + + + org.mockito + mockito-junit-jupiter + test + + + org.kie.kogito + kogito-quarkus-test-utils + test - org.apache.maven.plugins - maven-compiler-plugin + maven-failsafe-plugin - - - org.mapstruct - mapstruct-processor - ${version.org.mapstruct} - - + + org.jboss.logmanager.LogManager + + + + test + + integration-test + verify + + + + + \ No newline at end of file diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/OracleStorageServiceProducer.java b/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JdbcStorageServiceProducer.java similarity index 95% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/OracleStorageServiceProducer.java rename to data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JdbcStorageServiceProducer.java index f14dde82e9..a5de13fbcf 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/OracleStorageServiceProducer.java +++ b/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JdbcStorageServiceProducer.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle; +package org.kie.kogito.index.jdbc; import org.kie.kogito.index.jpa.storage.JPAStorageService; import org.kie.kogito.index.jpa.storage.JobEntityStorage; @@ -34,12 +34,12 @@ import static org.kie.kogito.persistence.api.factory.Constants.PERSISTENCE_TYPE_PROPERTY; -public class OracleStorageServiceProducer { +public class JdbcStorageServiceProducer { @Produces @Alternative @Priority(1) @ApplicationScoped - @IfBuildProperty(name = PERSISTENCE_TYPE_PROPERTY, stringValue = "oracle") + @IfBuildProperty(name = PERSISTENCE_TYPE_PROPERTY, stringValue = "jdbc") StorageService PostgreSqlStorageService(final ProcessDefinitionEntityStorage definitionStorage, final ProcessInstanceEntityStorage processStorage, final JobEntityStorage jobStorage, diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/JsonBinaryConverter.java b/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JsonBinaryConverter.java similarity index 97% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/JsonBinaryConverter.java rename to data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JsonBinaryConverter.java index 5701e70dc0..586f60ed18 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/main/java/org/kie/kogito/index/oracle/JsonBinaryConverter.java +++ b/data-index/data-index-storage/data-index-storage-jpa/src/main/java/org/kie/kogito/index/jdbc/JsonBinaryConverter.java @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.oracle; +package org.kie.kogito.index.jdbc; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/orm.xml b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/META-INF/orm.xml similarity index 78% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/orm.xml rename to data-index/data-index-storage/data-index-storage-jpa/src/main/resources/META-INF/orm.xml index ff5279f699..2e9789c752 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/orm.xml +++ b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/META-INF/orm.xml @@ -7,7 +7,7 @@ - + @@ -15,11 +15,11 @@ - + - + @@ -27,7 +27,7 @@ - + diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.33.0__data_index_create.sql b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.33.0__data_index_create.sql similarity index 100% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.33.0__data_index_create.sql rename to data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.33.0__data_index_create.sql diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.44.0__data_index_definitions.sql b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.44.0__data_index_definitions.sql similarity index 100% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.44.0__data_index_definitions.sql rename to data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.44.0__data_index_definitions.sql diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.45.0.0__data_index_node_definitions.sql b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.45.0.0__data_index_node_definitions.sql similarity index 100% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.45.0.0__data_index_node_definitions.sql rename to data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.45.0.0__data_index_node_definitions.sql diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.45.0.1__add_identity_to_process_instance.sql b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.45.0.1__add_identity_to_process_instance.sql similarity index 100% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.45.0.1__add_identity_to_process_instance.sql rename to data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.45.0.1__add_identity_to_process_instance.sql diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.45.0.2__data_index_definitions_add_collums.sql b/data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.45.0.2__data_index_definitions_add_collums.sql similarity index 100% rename from data-index/data-index-storage/data-index-storage-oracle/src/main/resources/db/migration/V1.45.0.2__data_index_definitions_add_collums.sql rename to data-index/data-index-storage/data-index-storage-jpa/src/main/resources/db/migration/V1.45.0.2__data_index_definitions_add_collums.sql diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingKafkaConsumerIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/JobEntityMapperIT.java similarity index 75% rename from data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingKafkaConsumerIT.java rename to data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/JobEntityMapperIT.java index ee54c4274a..5d85af3fcd 100644 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingKafkaConsumerIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/JobEntityMapperIT.java @@ -16,15 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.service.messaging; +package org.kie.kogito.index.jdbc.mapper; -import org.kie.kogito.index.service.test.KafkaMessageTestProfile; +import org.kie.kogito.index.jpa.mapper.AbstractJobEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; @QuarkusTest -@TestProfile(KafkaMessageTestProfile.class) -class OracleMessagingKafkaConsumerIT extends AbstractMessagingKafkaConsumerIT { - +class JobEntityMapperIT extends AbstractJobEntityMapperIT { } diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingHttpConsumerIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessDefinitionEntityMapperIT.java similarity index 75% rename from data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingHttpConsumerIT.java rename to data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessDefinitionEntityMapperIT.java index 1a255cf16d..f2ea4d334b 100644 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/messaging/OracleMessagingHttpConsumerIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessDefinitionEntityMapperIT.java @@ -16,15 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.service.messaging; +package org.kie.kogito.index.jdbc.mapper; -import org.kie.kogito.index.service.test.InMemoryMessageTestProfile; +import org.kie.kogito.index.jpa.mapper.AbstractProcessDefinitionEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; @QuarkusTest -@TestProfile(InMemoryMessageTestProfile.class) -class OracleMessagingHttpConsumerIT extends AbstractMessagingHttpConsumerIT { - +class ProcessDefinitionEntityMapperIT extends AbstractProcessDefinitionEntityMapperIT { } diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/OracleIndexingServiceIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessInstanceEntityMapperIT.java similarity index 76% rename from data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/OracleIndexingServiceIT.java rename to data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessInstanceEntityMapperIT.java index 436ba483ca..5c3230ddbe 100644 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/OracleIndexingServiceIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/ProcessInstanceEntityMapperIT.java @@ -16,15 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.service; +package org.kie.kogito.index.jdbc.mapper; -import org.kie.kogito.index.service.test.InMemoryMessageTestProfile; +import org.kie.kogito.index.jpa.mapper.AbstractProcessInstanceEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; @QuarkusTest -@TestProfile(InMemoryMessageTestProfile.class) -class OracleIndexingServiceIT extends AbstractIndexingServiceIT { +class ProcessInstanceEntityMapperIT extends AbstractProcessInstanceEntityMapperIT { } diff --git a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/KeycloakOracleIndexingServiceIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/UserTaskInstanceEntityMapperIT.java similarity index 75% rename from data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/KeycloakOracleIndexingServiceIT.java rename to data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/UserTaskInstanceEntityMapperIT.java index d5b17e14b8..64131ffe24 100644 --- a/data-index/data-index-service/data-index-service-oracle/src/test/java/org/kie/kogito/index/service/KeycloakOracleIndexingServiceIT.java +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/mapper/UserTaskInstanceEntityMapperIT.java @@ -16,15 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.kie.kogito.index.service; +package org.kie.kogito.index.jdbc.mapper; -import org.kie.kogito.index.service.test.KeycloakTestProfile; +import org.kie.kogito.index.jpa.mapper.AbstractUserTaskInstanceEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.TestProfile; @QuarkusTest -@TestProfile(KeycloakTestProfile.class) -class KeycloakOracleIndexingServiceIT extends AbstractKeycloakIntegrationIndexingServiceIT { +class UserTaskInstanceEntityMapperIT extends AbstractUserTaskInstanceEntityMapperIT { } diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/JobEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/JobEntityQueryIT.java new file mode 100644 index 0000000000..a99c7eeabd --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/JobEntityQueryIT.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.query; + +import org.kie.kogito.index.jpa.query.AbstractJobEntityQueryIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +class JobEntityQueryIT extends AbstractJobEntityQueryIT { + +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessDefinitionEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessDefinitionEntityQueryIT.java new file mode 100644 index 0000000000..c99803b83a --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessDefinitionEntityQueryIT.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.query; + +import org.kie.kogito.index.jpa.query.AbstractProcessDefinitionEntityQueryIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +class ProcessDefinitionEntityQueryIT extends AbstractProcessDefinitionEntityQueryIT { + +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessInstanceEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessInstanceEntityQueryIT.java new file mode 100644 index 0000000000..10bd679b53 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/ProcessInstanceEntityQueryIT.java @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.query; + +import org.kie.kogito.index.jpa.query.AbstractProcessInstanceEntityQueryIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +class ProcessInstanceEntityQueryIT extends AbstractProcessInstanceEntityQueryIT { + + @Override + protected Boolean isDateTimeAsLong() { + return false; + } +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/UserTaskInstanceEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/UserTaskInstanceEntityQueryIT.java new file mode 100644 index 0000000000..abaffc8741 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/query/UserTaskInstanceEntityQueryIT.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.query; + +import org.kie.kogito.index.jpa.query.AbstractUserTaskInstanceEntityQueryIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +class UserTaskInstanceEntityQueryIT extends AbstractUserTaskInstanceEntityQueryIT { + +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/JobStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/JobStorageIT.java new file mode 100644 index 0000000000..88c5db0fbb --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/JobStorageIT.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.storage; + +import org.kie.kogito.index.jpa.storage.AbstractJobStorageIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +public class JobStorageIT extends AbstractJobStorageIT { + +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessDefinitionStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessDefinitionStorageIT.java new file mode 100644 index 0000000000..b0369d8369 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessDefinitionStorageIT.java @@ -0,0 +1,31 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.storage; + +import org.kie.kogito.index.jpa.storage.AbstractProcessDefinitionStorageIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +class ProcessDefinitionStorageIT extends AbstractProcessDefinitionStorageIT { + +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessInstanceStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessInstanceStorageIT.java new file mode 100644 index 0000000000..9f40d50928 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/ProcessInstanceStorageIT.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.storage; + +import org.kie.kogito.index.jpa.storage.AbstractProcessInstanceStorageIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +public class ProcessInstanceStorageIT extends AbstractProcessInstanceStorageIT { +} diff --git a/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/UserTaskInstanceStorageIT.java b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/UserTaskInstanceStorageIT.java new file mode 100644 index 0000000000..4a6b9921e5 --- /dev/null +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/java/org/kie/kogito/index/jdbc/storage/UserTaskInstanceStorageIT.java @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.kie.kogito.index.jdbc.storage; + +import org.kie.kogito.index.jpa.storage.AbstractUserTaskInstanceStorageIT; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.h2.H2DatabaseTestResource; +import io.quarkus.test.junit.QuarkusTest; + +@QuarkusTest +@QuarkusTestResource(H2DatabaseTestResource.class) +public class UserTaskInstanceStorageIT extends AbstractUserTaskInstanceStorageIT { +} diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/resources/application.properties b/data-index/data-index-storage/data-index-storage-jpa/src/test/resources/application.properties similarity index 84% rename from data-index/data-index-storage/data-index-storage-oracle/src/test/resources/application.properties rename to data-index/data-index-storage/data-index-storage-jpa/src/test/resources/application.properties index 6dbb374445..5cf2dfb3a2 100644 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/resources/application.properties +++ b/data-index/data-index-storage/data-index-storage-jpa/src/test/resources/application.properties @@ -18,12 +18,10 @@ # # Kogito -kogito.apps.persistence.type=oracle +kogito.apps.persistence.type=jdbc # Data source -quarkus.datasource.db-kind=oracle -quarkus.datasource.username=kogito -quarkus.datasource.password=kogito -quarkus.datasource.jdbc.url=jdbc:oracle://localhost:1521/kogito +quarkus.datasource.db-kind=h2 +quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test;NON_KEYWORDS=VALUE,KEY # Hibernate quarkus.hibernate-orm.database.generation=create quarkus.hibernate-orm.database.generation.halt-on-error=true diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/beans.xml b/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/beans.xml deleted file mode 100644 index a0eb9fbf8c..0000000000 --- a/data-index/data-index-storage/data-index-storage-oracle/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java b/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java deleted file mode 100644 index 6e2c2dfde5..0000000000 --- a/data-index/data-index-storage/data-index-storage-oracle/src/test/java/org/kie/kogito/index/oracle/schema/DDLSchemaExporter.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.oracle.schema; - -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; - -import org.hibernate.boot.Metadata; -import org.hibernate.boot.MetadataSources; -import org.hibernate.boot.registry.StandardServiceRegistry; -import org.hibernate.boot.registry.StandardServiceRegistryBuilder; -import org.hibernate.cfg.Environment; -import org.hibernate.tool.hbm2ddl.SchemaExport; -import org.hibernate.tool.schema.TargetType; -import org.kie.kogito.index.jpa.model.AttachmentEntity; -import org.kie.kogito.index.jpa.model.CommentEntity; -import org.kie.kogito.index.jpa.model.JobEntity; -import org.kie.kogito.index.jpa.model.MilestoneEntity; -import org.kie.kogito.index.jpa.model.NodeEntity; -import org.kie.kogito.index.jpa.model.NodeInstanceEntity; -import org.kie.kogito.index.jpa.model.ProcessDefinitionEntity; -import org.kie.kogito.index.jpa.model.ProcessInstanceEntity; -import org.kie.kogito.index.jpa.model.ProcessInstanceErrorEntity; -import org.kie.kogito.index.jpa.model.UserTaskInstanceEntity; -import org.kie.kogito.testcontainers.KogitoOracleSqlContainer; - -public class DDLSchemaExporter { - - public static void main(String[] args) { - try (KogitoOracleSqlContainer oracleSql = new KogitoOracleSqlContainer()) { - oracleSql.start(); - Map settings = new HashMap<>(); - settings.put(Environment.URL, oracleSql.getJdbcUrl()); - settings.put(Environment.USER, oracleSql.getUsername()); - settings.put(Environment.PASS, oracleSql.getPassword()); - settings.put(Environment.PHYSICAL_NAMING_STRATEGY, "org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy"); - - StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(settings).build(); - - MetadataSources metadataSources = new MetadataSources(serviceRegistry); - metadataSources.addAnnotatedClass(NodeEntity.class); - metadataSources.addAnnotatedClass(ProcessDefinitionEntity.class); - metadataSources.addAnnotatedClass(JobEntity.class); - metadataSources.addAnnotatedClass(MilestoneEntity.class); - metadataSources.addAnnotatedClass(NodeInstanceEntity.class); - metadataSources.addAnnotatedClass(ProcessInstanceEntity.class); - metadataSources.addAnnotatedClass(ProcessInstanceErrorEntity.class); - metadataSources.addAnnotatedClass(AttachmentEntity.class); - metadataSources.addAnnotatedClass(CommentEntity.class); - metadataSources.addAnnotatedClass(UserTaskInstanceEntity.class); - Metadata metadata = metadataSources.buildMetadata(); - - SchemaExport schemaExport = new SchemaExport(); - schemaExport.setDelimiter(";"); - schemaExport.setFormat(true); - schemaExport.setOverrideOutputFileContent(); - schemaExport.setOutputFile("src/main/resources/data_index_create.sql"); - schemaExport.createOnly(EnumSet.of(TargetType.SCRIPT), metadata); - schemaExport.getExceptions().forEach(System.err::println); - } catch (Exception ex) { - ex.printStackTrace(); - } - } -} diff --git a/data-index/data-index-storage/data-index-storage-postgresql/pom.xml b/data-index/data-index-storage/data-index-storage-postgresql/pom.xml index 6b75513be0..2f552ad5fb 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/pom.xml +++ b/data-index/data-index-storage/data-index-storage-postgresql/pom.xml @@ -39,7 +39,7 @@ org.kie.kogito - data-index-storage-jpa + data-index-storage-jpa-common org.kie.kogito @@ -51,6 +51,13 @@ test-jar test + + org.kie.kogito + data-index-storage-jpa-common + test-jar + test + ${project.version} + io.quarkus quarkus-junit5-mockito diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/JobEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/JobEntityMapperIT.java index 8b18c82c38..42a74c5b9b 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/JobEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/JobEntityMapperIT.java @@ -18,89 +18,10 @@ */ package org.kie.kogito.index.postgresql.mapper; -import java.time.ZonedDateTime; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.JobEntityMapper; -import org.kie.kogito.index.jpa.model.JobEntity; -import org.kie.kogito.index.model.Job; +import org.kie.kogito.index.jpa.mapper.AbstractJobEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - -import static org.assertj.core.api.Assertions.assertThat; - @QuarkusTest -class JobEntityMapperIT { - - @Inject - JobEntityMapper mapper; - - Job job = new Job(); - - JobEntity jobEntity = new JobEntity(); - - @BeforeEach - void setup() { - String testId = "testId"; - ZonedDateTime time = ZonedDateTime.now(); - String status = "ACTIVE"; - String processId = "testProcessId"; - String processInstanceId = "testProcessInstanceId"; - String rootProcessId = "testRootProcessId"; - String rootProcessInstanceId = "testRootProcessInstanceId"; - Integer priority = 79; - String callbackEndpoint = "testCallbackEndpoint"; - Long repeatInterval = 70L; - Integer repeatLimit = 89; - String scheduledId = "testScheduleId"; - Integer retries = 25; - Integer executionCounter = 17; - - job.setId(testId); - job.setStatus(status); - job.setLastUpdate(time); - job.setProcessId(processId); - job.setProcessInstanceId(processInstanceId); - job.setRootProcessId(rootProcessId); - job.setRootProcessInstanceId(rootProcessInstanceId); - job.setExpirationTime(time); - job.setPriority(priority); - job.setCallbackEndpoint(callbackEndpoint); - job.setRepeatInterval(repeatInterval); - job.setRepeatLimit(repeatLimit); - job.setScheduledId(scheduledId); - job.setRetries(retries); - job.setExecutionCounter(executionCounter); - - jobEntity.setId(testId); - jobEntity.setStatus(status); - jobEntity.setLastUpdate(time); - jobEntity.setProcessId(processId); - jobEntity.setProcessInstanceId(processInstanceId); - jobEntity.setRootProcessId(rootProcessId); - jobEntity.setRootProcessInstanceId(rootProcessInstanceId); - jobEntity.setExpirationTime(time); - jobEntity.setPriority(priority); - jobEntity.setCallbackEndpoint(callbackEndpoint); - jobEntity.setRepeatInterval(repeatInterval); - jobEntity.setRepeatLimit(repeatLimit); - jobEntity.setScheduledId(scheduledId); - jobEntity.setRetries(retries); - jobEntity.setExecutionCounter(executionCounter); - } - - @Test - void testMapToEntity() { - JobEntity result = mapper.mapToEntity(job); - assertThat(result).isEqualToIgnoringGivenFields(jobEntity, "$$_hibernate_tracker"); - } - - @Test - void testMapToModel() { - Job result = mapper.mapToModel(jobEntity); - assertThat(result).isEqualToComparingFieldByField(job); - } +class JobEntityMapperIT extends AbstractJobEntityMapperIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessDefinitionEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessDefinitionEntityMapperIT.java index 35634f9713..eb7cef3d14 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessDefinitionEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessDefinitionEntityMapperIT.java @@ -18,88 +18,10 @@ */ package org.kie.kogito.index.postgresql.mapper; -import java.util.Set; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.ProcessDefinitionEntityMapper; -import org.kie.kogito.index.jpa.model.NodeEntity; -import org.kie.kogito.index.jpa.model.ProcessDefinitionEntity; -import org.kie.kogito.index.model.Node; -import org.kie.kogito.index.model.ProcessDefinition; +import org.kie.kogito.index.jpa.mapper.AbstractProcessDefinitionEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - -import static java.util.Collections.singleton; -import static java.util.Collections.singletonList; -import static java.util.Collections.singletonMap; -import static org.assertj.core.api.Assertions.assertThat; - @QuarkusTest -class ProcessDefinitionEntityMapperIT { - - ProcessDefinition pd = new ProcessDefinition(); - ProcessDefinitionEntity entity = new ProcessDefinitionEntity(); - - @Inject - ProcessDefinitionEntityMapper mapper; - - @BeforeEach - void setup() { - String version = "1.0"; - String processId = "testProcessId"; - Set roles = singleton("testRoles"); - String type = "testType"; - Set addons = singleton("testAddons"); - - String nodeId = "testNodeId"; - String nodeName = "testNodeName"; - String nodeUniqueId = "testNodeUniqueId"; - String nodeMetadataUniqueId = "testMetadataUniqueId"; - String nodeType = "testNodeType"; - - Node node = new Node(); - node.setId(nodeId); - node.setName(nodeName); - node.setType(nodeType); - node.setUniqueId(nodeUniqueId); - node.setMetadata(singletonMap("UniqueId", nodeMetadataUniqueId)); - - pd.setId(processId); - pd.setVersion(version); - pd.setRoles(roles); - pd.setAddons(addons); - pd.setType(type); - pd.setNodes(singletonList(node)); - - NodeEntity nodeEntity = new NodeEntity(); - nodeEntity.setId(nodeId); - nodeEntity.setName(nodeName); - nodeEntity.setType(nodeType); - nodeEntity.setUniqueId(nodeUniqueId); - nodeEntity.setMetadata(singletonMap("UniqueId", nodeMetadataUniqueId)); - nodeEntity.setProcessDefinition(entity); - - entity.setId(processId); - entity.setVersion(version); - entity.setRoles(roles); - entity.setAddons(addons); - entity.setType(type); - entity.setNodes(singletonList(nodeEntity)); - } - - @Test - void testMapToEntity() { - ProcessDefinitionEntity result = mapper.mapToEntity(pd); - assertThat(result).usingRecursiveComparison().ignoringFieldsMatchingRegexes(".*\\$\\$_hibernate_tracker").isEqualTo(entity); - } - - @Test - void testMapToModel() { - ProcessDefinition result = mapper.mapToModel(entity); - assertThat(result).usingRecursiveComparison().isEqualTo(pd); - } - +class ProcessDefinitionEntityMapperIT extends AbstractProcessDefinitionEntityMapperIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessInstanceEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessInstanceEntityMapperIT.java index ea0b9fdba8..949bd0c010 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessInstanceEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/ProcessInstanceEntityMapperIT.java @@ -18,169 +18,10 @@ */ package org.kie.kogito.index.postgresql.mapper; -import java.time.ZonedDateTime; -import java.util.Set; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.ProcessInstanceEntityMapper; -import org.kie.kogito.index.jpa.model.MilestoneEntity; -import org.kie.kogito.index.jpa.model.MilestoneEntityId; -import org.kie.kogito.index.jpa.model.NodeInstanceEntity; -import org.kie.kogito.index.jpa.model.ProcessInstanceEntity; -import org.kie.kogito.index.jpa.model.ProcessInstanceErrorEntity; -import org.kie.kogito.index.model.Milestone; -import org.kie.kogito.index.model.NodeInstance; -import org.kie.kogito.index.model.ProcessInstance; -import org.kie.kogito.index.model.ProcessInstanceError; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; +import org.kie.kogito.index.jpa.mapper.AbstractProcessInstanceEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - -import static java.util.Collections.singleton; -import static java.util.Collections.singletonList; -import static org.assertj.core.api.Assertions.assertThat; - @QuarkusTest -class ProcessInstanceEntityMapperIT { - - ObjectMapper jsonMapper = new ObjectMapper(); - ProcessInstance processInstance = new ProcessInstance(); - ProcessInstanceEntity processInstanceEntity = new ProcessInstanceEntity(); - - @Inject - ProcessInstanceEntityMapper mapper; - - @BeforeEach - void setup() { - String nodeInstanceId = "testNodeInstanceId"; - String nodeInstanceName = "testNodeInstanceName"; - String nodeInstanceNodeId = "testNodeInstanceNodeId"; - String nodeInstanceType = "testNodeInstanceType"; - String nodeInstanceDefinitionId = "testNodeInstanceDefinitionId"; - - String processInstanceErrorMessage = "testProcessInstanceErrorMessage"; - String processInstanceErrorNodeDefinitionId = "testProcessInstanceErrorNodeDefinitionId"; - - String milestoneId = "testMilestone"; - String milestoneName = "testMilestoneName"; - String milestoneStatus = "testMilestoneStatus"; - - String testId = "testId"; - String processId = "testProcessId"; - Set roles = singleton("testRoles"); - ObjectNode variables = jsonMapper.createObjectNode(); - variables.put("test", "testValue"); - String endpoint = "testEndpoint"; - Integer state = 2; - ZonedDateTime time = ZonedDateTime.now(); - String rootProcessId = "testRootProcessId"; - String rootProcessInstanceId = "testRootProcessInstanceId"; - String parentProcessInstanceId = "testParentProcessInstanceId"; - String processName = "testProcessName"; - Set addons = singleton("testAddons"); - String businessKey = "testBusinessKey"; - String createdBy = "initiatorUser"; - String updatedBy = "currentUser"; - - NodeInstance nodeInstance = new NodeInstance(); - nodeInstance.setId(nodeInstanceId); - nodeInstance.setDefinitionId(nodeInstanceDefinitionId); - nodeInstance.setExit(time); - nodeInstance.setEnter(time); - nodeInstance.setType(nodeInstanceType); - nodeInstance.setNodeId(nodeInstanceNodeId); - nodeInstance.setName(nodeInstanceName); - - ProcessInstanceError processInstanceError = new ProcessInstanceError(); - processInstanceError.setMessage(processInstanceErrorMessage); - processInstanceError.setNodeDefinitionId(processInstanceErrorNodeDefinitionId); - - Milestone milestone = new Milestone(); - milestone.setId(milestoneId); - milestone.setName(milestoneName); - milestone.setStatus(milestoneStatus); - - processInstance.setId(testId); - processInstance.setProcessId(processId); - processInstance.setRoles(roles); - processInstance.setVariables(variables); - processInstance.setEndpoint(endpoint); - processInstance.setNodes(singletonList(nodeInstance)); - processInstance.setState(state); - processInstance.setStart(time); - processInstance.setEnd(time); - processInstance.setRootProcessId(rootProcessId); - processInstance.setRootProcessInstanceId(rootProcessInstanceId); - processInstance.setParentProcessInstanceId(parentProcessInstanceId); - processInstance.setProcessName(processName); - processInstance.setError(processInstanceError); - processInstance.setAddons(addons); - processInstance.setLastUpdate(time); - processInstance.setBusinessKey(businessKey); - processInstance.setMilestones(singletonList(milestone)); - processInstance.setCreatedBy(createdBy); - processInstance.setUpdatedBy(updatedBy); - - NodeInstanceEntity nodeInstanceEntity = new NodeInstanceEntity(); - nodeInstanceEntity.setId(nodeInstanceId); - nodeInstanceEntity.setDefinitionId(nodeInstanceDefinitionId); - nodeInstanceEntity.setEnter(time); - nodeInstanceEntity.setExit(time); - nodeInstanceEntity.setName(nodeInstanceName); - nodeInstanceEntity.setNodeId(nodeInstanceNodeId); - nodeInstanceEntity.setType(nodeInstanceType); - nodeInstanceEntity.setProcessInstance(processInstanceEntity); - - ProcessInstanceErrorEntity processInstanceErrorEntity = new ProcessInstanceErrorEntity(); - processInstanceErrorEntity.setMessage(processInstanceErrorMessage); - processInstanceErrorEntity.setNodeDefinitionId(processInstanceErrorNodeDefinitionId); - - MilestoneEntity milestoneEntity = new MilestoneEntity(); - MilestoneEntityId milestoneEntityId = new MilestoneEntityId(); - milestoneEntityId.setId(milestoneId); - milestoneEntityId.setProcessInstance(testId); - milestoneEntity.setId(milestoneId); - milestoneEntity.setName(milestoneName); - milestoneEntity.setStatus(milestoneStatus); - milestoneEntity.setProcessInstance(processInstanceEntity); - - processInstanceEntity.setId(testId); - processInstanceEntity.setProcessId(processId); - processInstanceEntity.setRoles(roles); - processInstanceEntity.setVariables(variables); - processInstanceEntity.setEndpoint(endpoint); - processInstanceEntity.setNodes(singletonList(nodeInstanceEntity)); - processInstanceEntity.setState(state); - processInstanceEntity.setStart(time); - processInstanceEntity.setEnd(time); - processInstanceEntity.setRootProcessId(rootProcessId); - processInstanceEntity.setRootProcessInstanceId(rootProcessInstanceId); - processInstanceEntity.setParentProcessInstanceId(parentProcessInstanceId); - processInstanceEntity.setProcessName(processName); - processInstanceEntity.setError(processInstanceErrorEntity); - processInstanceEntity.setAddons(addons); - processInstanceEntity.setLastUpdate(time); - processInstanceEntity.setBusinessKey(businessKey); - processInstanceEntity.setMilestones(singletonList(milestoneEntity)); - processInstanceEntity.setCreatedBy(createdBy); - processInstanceEntity.setUpdatedBy(updatedBy); - } - - @Test - void testMapToEntity() { - ProcessInstanceEntity result = mapper.mapToEntity(processInstance); - assertThat(result).usingRecursiveComparison().ignoringFieldsMatchingRegexes(".*\\$\\$_hibernate_tracker").isEqualTo(processInstanceEntity); - } - - @Test - void testMapToModel() { - ProcessInstance result = mapper.mapToModel(processInstanceEntity); - assertThat(result).usingRecursiveComparison().isEqualTo(processInstance); - } - +class ProcessInstanceEntityMapperIT extends AbstractProcessInstanceEntityMapperIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/UserTaskInstanceEntityMapperIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/UserTaskInstanceEntityMapperIT.java index 39574a8020..65a1ef1a6c 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/UserTaskInstanceEntityMapperIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/mapper/UserTaskInstanceEntityMapperIT.java @@ -18,151 +18,10 @@ */ package org.kie.kogito.index.postgresql.mapper; -import java.time.ZonedDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.mapper.UserTaskInstanceEntityMapper; -import org.kie.kogito.index.jpa.model.AttachmentEntity; -import org.kie.kogito.index.jpa.model.CommentEntity; -import org.kie.kogito.index.jpa.model.UserTaskInstanceEntity; -import org.kie.kogito.index.model.Attachment; -import org.kie.kogito.index.model.Comment; -import org.kie.kogito.index.model.UserTaskInstance; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; +import org.kie.kogito.index.jpa.mapper.AbstractUserTaskInstanceEntityMapperIT; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - -import static java.util.Collections.singleton; -import static java.util.Collections.singletonList; -import static org.assertj.core.api.Assertions.assertThat; - @QuarkusTest -class UserTaskInstanceEntityMapperIT { - - UserTaskInstance userTaskInstance = new UserTaskInstance(); - UserTaskInstanceEntity userTaskInstanceEntity = new UserTaskInstanceEntity(); - - @Inject - ObjectMapper jsonMapper; - - @Inject - UserTaskInstanceEntityMapper mapper; - - @BeforeEach - void setup() { - String testId = "testId"; - String description = "testDescription"; - String name = "testName"; - String priority = "10"; - String processInstanceId = "testProcessInstanceId"; - String state = "testState"; - String actualOwner = "testActualOwner"; - Set adminGroups = singleton("testAdminGroups"); - Set adminUsers = singleton("testAdminUsers"); - ZonedDateTime time = ZonedDateTime.now(); - Set excludedUsers = singleton("testExcludedUsers"); - Set potentialGroups = singleton("testPotentialGroups"); - Set potentialUsers = singleton("testPotentialUsers"); - String referenceName = "testReferenceName"; - String processId = "testProcessId"; - String rootProcessId = "testRootProcessId"; - String rootProcessInstanceId = "testRootProcessInstanceId"; - Map object = new HashMap<>(); - object.put("test", "testValue"); - ObjectNode inputs = jsonMapper.createObjectNode().put("testInput", "testValue"); - ObjectNode outputs = jsonMapper.createObjectNode().put("testOutput", "testValue"); - - String commentId = "testCommentId"; - String comment_content = "testCommentContent"; - String comment_updatedBy = "testCommentUpdatedBy"; - Comment comment = Comment.builder().id(commentId).updatedAt(time).updatedBy(comment_updatedBy).content(comment_content).build(); - CommentEntity commentEntity = new CommentEntity(); - commentEntity.setId(commentId); - commentEntity.setContent(comment_content); - commentEntity.setUpdatedAt(time); - commentEntity.setUpdatedBy(comment_updatedBy); - commentEntity.setUserTask(userTaskInstanceEntity); - - String attachmentId = "testAttachmentId"; - String attachment_name = "testAttachmentName"; - String attachment_content = "testAttachmentContent"; - String attachment_updatedBy = "testAttachmentUpdatedBy"; - Attachment attachment = Attachment.builder().id(attachmentId).updatedAt(time).updatedBy(attachment_updatedBy) - .content(attachment_content).name(attachment_name).build(); - AttachmentEntity attachmentEntity = new AttachmentEntity(); - attachmentEntity.setId(attachmentId); - attachmentEntity.setContent(attachment_content); - attachmentEntity.setName(attachment_name); - attachmentEntity.setUpdatedAt(time); - attachmentEntity.setUpdatedBy(attachment_updatedBy); - attachmentEntity.setUserTask(userTaskInstanceEntity); - - userTaskInstance.setId(testId); - userTaskInstance.setDescription(description); - userTaskInstance.setName(name); - userTaskInstance.setPriority(priority); - userTaskInstance.setProcessInstanceId(processInstanceId); - userTaskInstance.setState(state); - userTaskInstance.setActualOwner(actualOwner); - userTaskInstance.setAdminGroups(adminGroups); - userTaskInstance.setAdminUsers(adminUsers); - userTaskInstance.setCompleted(time); - userTaskInstance.setStarted(time); - userTaskInstance.setExcludedUsers(excludedUsers); - userTaskInstance.setPotentialGroups(potentialGroups); - userTaskInstance.setPotentialUsers(potentialUsers); - userTaskInstance.setReferenceName(referenceName); - userTaskInstance.setLastUpdate(time); - userTaskInstance.setProcessId(processId); - userTaskInstance.setRootProcessId(rootProcessId); - userTaskInstance.setRootProcessInstanceId(rootProcessInstanceId); - userTaskInstance.setInputs(inputs); - userTaskInstance.setOutputs(outputs); - userTaskInstance.setComments(singletonList(comment)); - userTaskInstance.setAttachments(singletonList(attachment)); - - userTaskInstanceEntity.setId(testId); - userTaskInstanceEntity.setDescription(description); - userTaskInstanceEntity.setName(name); - userTaskInstanceEntity.setPriority(priority); - userTaskInstanceEntity.setProcessInstanceId(processInstanceId); - userTaskInstanceEntity.setState(state); - userTaskInstanceEntity.setActualOwner(actualOwner); - userTaskInstanceEntity.setAdminGroups(adminGroups); - userTaskInstanceEntity.setAdminUsers(adminUsers); - userTaskInstanceEntity.setCompleted(time); - userTaskInstanceEntity.setStarted(time); - userTaskInstanceEntity.setExcludedUsers(excludedUsers); - userTaskInstanceEntity.setPotentialGroups(potentialGroups); - userTaskInstanceEntity.setPotentialUsers(potentialUsers); - userTaskInstanceEntity.setReferenceName(referenceName); - userTaskInstanceEntity.setLastUpdate(time); - userTaskInstanceEntity.setProcessId(processId); - userTaskInstanceEntity.setRootProcessId(rootProcessId); - userTaskInstanceEntity.setRootProcessInstanceId(rootProcessInstanceId); - userTaskInstanceEntity.setInputs(inputs); - userTaskInstanceEntity.setOutputs(outputs); - userTaskInstanceEntity.setComments(singletonList(commentEntity)); - userTaskInstanceEntity.setAttachments(singletonList(attachmentEntity)); - } - - @Test - void testMapToEntity() { - UserTaskInstanceEntity result = mapper.mapToEntity(userTaskInstance); - assertThat(result).isEqualToIgnoringGivenFields(userTaskInstanceEntity, "$$_hibernate_tracker"); - } - - @Test - void testMapToModel() { - UserTaskInstance result = mapper.mapToModel(userTaskInstanceEntity); - assertThat(result).isEqualToComparingFieldByField(userTaskInstance); - } +class UserTaskInstanceEntityMapperIT extends AbstractUserTaskInstanceEntityMapperIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/JobEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/JobEntityQueryIT.java index b97a783fbf..90502e9075 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/JobEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/JobEntityQueryIT.java @@ -18,27 +18,13 @@ */ package org.kie.kogito.index.postgresql.query; -import org.kie.kogito.index.jpa.storage.JobEntityStorage; -import org.kie.kogito.index.model.Job; -import org.kie.kogito.index.test.query.AbstractJobQueryIT; -import org.kie.kogito.persistence.api.Storage; +import org.kie.kogito.index.jpa.query.AbstractJobEntityQueryIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -class JobEntityQueryIT extends AbstractJobQueryIT { - - @Inject - JobEntityStorage storage; - - @Override - public Storage getStorage() { - return storage; - } - +class JobEntityQueryIT extends AbstractJobEntityQueryIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessDefinitionEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessDefinitionEntityQueryIT.java index 28384df31a..0f304623be 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessDefinitionEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessDefinitionEntityQueryIT.java @@ -18,31 +18,13 @@ */ package org.kie.kogito.index.postgresql.query; -import org.kie.kogito.index.jpa.storage.ProcessDefinitionEntityStorage; -import org.kie.kogito.index.model.ProcessDefinition; -import org.kie.kogito.index.test.query.AbstractProcessDefinitionQueryIT; -import org.kie.kogito.persistence.api.Storage; +import org.kie.kogito.index.jpa.query.AbstractProcessDefinitionEntityQueryIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -class ProcessDefinitionEntityQueryIT extends AbstractProcessDefinitionQueryIT { - - @Inject - ProcessDefinitionEntityStorage storage; - - @Override - public Storage getStorage() { - return storage; - } - - @Override - protected Boolean isDateTimeAsLong() { - return false; - } +class ProcessDefinitionEntityQueryIT extends AbstractProcessDefinitionEntityQueryIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessInstanceEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessInstanceEntityQueryIT.java index 5e963cee98..254bca48f2 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessInstanceEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/ProcessInstanceEntityQueryIT.java @@ -18,30 +18,13 @@ */ package org.kie.kogito.index.postgresql.query; -import org.kie.kogito.index.jpa.storage.ProcessInstanceEntityStorage; -import org.kie.kogito.index.storage.ProcessInstanceStorage; -import org.kie.kogito.index.test.query.AbstractProcessInstanceQueryIT; +import org.kie.kogito.index.jpa.query.AbstractProcessInstanceEntityQueryIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -class ProcessInstanceEntityQueryIT extends AbstractProcessInstanceQueryIT { - - @Inject - ProcessInstanceEntityStorage storage; - - @Override - public ProcessInstanceStorage getStorage() { - return storage; - } - - @Override - protected Boolean isDateTimeAsLong() { - return false; - } +class ProcessInstanceEntityQueryIT extends AbstractProcessInstanceEntityQueryIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/UserTaskInstanceEntityQueryIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/UserTaskInstanceEntityQueryIT.java index f0e2a6fc9b..399e5ecf2d 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/UserTaskInstanceEntityQueryIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/query/UserTaskInstanceEntityQueryIT.java @@ -18,30 +18,14 @@ */ package org.kie.kogito.index.postgresql.query; -import org.kie.kogito.index.jpa.storage.UserTaskInstanceEntityStorage; -import org.kie.kogito.index.storage.UserTaskInstanceStorage; -import org.kie.kogito.index.test.query.AbstractUserTaskInstanceQueryIT; +import org.kie.kogito.index.jpa.query.AbstractUserTaskInstanceEntityQueryIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -class UserTaskInstanceEntityQueryIT extends AbstractUserTaskInstanceQueryIT { - - @Inject - UserTaskInstanceEntityStorage storage; - - @Override - public UserTaskInstanceStorage getStorage() { - return storage; - } +class UserTaskInstanceEntityQueryIT extends AbstractUserTaskInstanceEntityQueryIT { - @Override - protected Boolean isDateTimeAsLong() { - return false; - } } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/AbstractStorageIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/AbstractStorageIT.java deleted file mode 100644 index 427e8d3d2a..0000000000 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/AbstractStorageIT.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.postgresql.storage; - -import org.kie.kogito.index.jpa.model.AbstractEntity; -import org.kie.kogito.persistence.api.Storage; -import org.kie.kogito.persistence.api.StorageService; - -import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; - -import static org.assertj.core.api.Assertions.assertThat; - -public abstract class AbstractStorageIT { - - Class type; - - public AbstractStorageIT(Class type) { - this.type = type; - } - - abstract StorageService getStorage(); - - abstract PanacheRepositoryBase getRepository(); - - void testStorage(String key, T value1, T value2) { - Storage cache = getStorage().getCache("cache", type); - assertThat(cache.get(key)).isNull(); - assertThat(cache.containsKey(key)).isFalse(); - - cache.put(key, value1); - assertThat(cache.get(key)).isEqualTo(value1); - assertThat(cache.containsKey(key)).isTrue(); - - cache.put(key, value2); - assertThat(cache.get(key)).isEqualTo(value2); - assertThat(cache.containsKey(key)).isTrue(); - - cache.remove(key); - assertThat(cache.get(key)).isNull(); - assertThat(cache.containsKey(key)).isFalse(); - } - -} diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/DomainQueryTest.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/DomainQueryTest.java deleted file mode 100644 index 20d85db1b1..0000000000 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/DomainQueryTest.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.postgresql.storage; - -import java.util.List; -import java.util.function.Function; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.kie.kogito.index.jpa.model.ProcessInstanceEntity; -import org.kie.kogito.index.jpa.storage.JPAQuery; -import org.kie.kogito.index.model.ProcessInstance; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase; - -import jakarta.persistence.EntityManager; -import jakarta.persistence.TypedQuery; -import jakarta.persistence.criteria.CriteriaBuilder; -import jakarta.persistence.criteria.CriteriaQuery; -import jakarta.persistence.criteria.Order; -import jakarta.persistence.criteria.Path; -import jakarta.persistence.criteria.Predicate; -import jakarta.persistence.criteria.Root; - -import static java.util.Arrays.asList; -import static java.util.Collections.emptyList; -import static org.assertj.core.api.Assertions.assertThat; -import static org.kie.kogito.persistence.api.query.QueryFilterFactory.orderBy; -import static org.kie.kogito.persistence.api.query.SortDirection.ASC; -import static org.kie.kogito.persistence.api.query.SortDirection.DESC; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@ExtendWith(MockitoExtension.class) -class DomainQueryTest { - - private static final Class rootType = ProcessInstanceEntity.class; - - @Mock - PanacheRepositoryBase repository; - - @Mock - EntityManager entityManager; - - @Mock - CriteriaBuilder criteriaBuilder; - - @Mock - CriteriaQuery criteriaQuery; - - @Mock - TypedQuery mockQuery; - - @BeforeEach - public void setup() { - when(repository.getEntityManager()).thenReturn(entityManager); - when(entityManager.getCriteriaBuilder()).thenReturn(criteriaBuilder); - when(criteriaBuilder.createQuery(rootType)).thenReturn(criteriaQuery); - when(entityManager.createQuery(criteriaQuery)).thenReturn(mockQuery); - } - - @Test - void testNoParameters() { - JPAQuery query = new JPAQuery(repository, Function.identity(), rootType); - - query.execute(); - - verify(criteriaQuery).from(rootType); - verify(criteriaQuery, never()).where(any(Predicate.class)); - verify(criteriaQuery, never()).orderBy(any(List.class)); - verify(entityManager).createQuery(criteriaQuery); - verify(mockQuery).getResultList(); - } - - @Test - void testEmptyParameters() { - JPAQuery query = new JPAQuery(repository, Function.identity(), rootType); - query.filter(emptyList()); - query.sort(emptyList()); - - query.execute(); - - verify(criteriaQuery).from(rootType); - verify(criteriaQuery, never()).where(any(Predicate.class)); - verify(criteriaQuery, never()).orderBy(any(List.class)); - verify(entityManager).createQuery(criteriaQuery); - verify(mockQuery).getResultList(); - } - - @Test - void testPagination() { - JPAQuery query = new JPAQuery(repository, Function.identity(), rootType); - query.limit(10); - query.offset(0); - - query.execute(); - - verify(criteriaQuery).from(rootType); - verify(criteriaQuery, never()).where(any(Predicate.class)); - verify(criteriaQuery, never()).orderBy(any(List.class)); - verify(entityManager).createQuery(criteriaQuery); - verify(mockQuery).setFirstResult(0); - verify(mockQuery).setMaxResults(10); - verify(mockQuery).getResultList(); - } - - @Test - void testOrderBy() { - Root root = mock(Root.class); - when(root.get(any(String.class))).thenAnswer(inv -> { - Path path = mock(Path.class); - when(path.getAlias()).thenReturn(inv.getArgument(0)); - return path; - }); - when(criteriaQuery.from(rootType)).thenReturn(root); - when(criteriaBuilder.asc(any())).thenAnswer(inv -> { - Order order = mock(Order.class); - when(order.isAscending()).thenReturn(true); - when(order.getExpression()).thenReturn(inv.getArgument(0)); - return order; - }); - when(criteriaBuilder.desc(any())).thenAnswer(inv -> { - Order order = mock(Order.class); - when(order.isAscending()).thenReturn(false); - when(order.getExpression()).thenReturn(inv.getArgument(0)); - return order; - }); - - JPAQuery query = new JPAQuery(repository, Function.identity(), rootType); - query.sort(asList(orderBy("name", DESC), orderBy("date", ASC))); - - query.execute(); - - verify(criteriaQuery).from(rootType); - verify(criteriaQuery, never()).where(any(Predicate.class)); - ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); - verify(criteriaQuery).orderBy(captor.capture()); - assertThat(captor.getValue()).hasSize(2); - assertThat(captor.getValue().get(0).isAscending()).isFalse(); - assertThat(captor.getValue().get(0).getExpression().getAlias()).isEqualTo("name"); - assertThat(captor.getValue().get(1).isAscending()).isTrue(); - assertThat(captor.getValue().get(1).getExpression().getAlias()).isEqualTo("date"); - verify(entityManager).createQuery(criteriaQuery); - verify(mockQuery).getResultList(); - } - -} diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/JobStorageIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/JobStorageIT.java index 91b5488eaa..168041a92d 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/JobStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/JobStorageIT.java @@ -18,58 +18,13 @@ */ package org.kie.kogito.index.postgresql.storage; -import java.util.UUID; - -import org.apache.commons.lang3.RandomStringUtils; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.model.JobEntity; -import org.kie.kogito.index.jpa.model.JobEntityRepository; -import org.kie.kogito.index.model.Job; -import org.kie.kogito.index.test.TestUtils; -import org.kie.kogito.persistence.api.StorageService; +import org.kie.kogito.index.jpa.storage.AbstractJobStorageIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -public class JobStorageIT extends AbstractStorageIT { - - @Inject - JobEntityRepository repository; - - @Inject - StorageService storage; - - public JobStorageIT() { - super(Job.class); - } - - @Override - public JobEntityRepository getRepository() { - return repository; - } - - @Override - public StorageService getStorage() { - return storage; - } - - @Test - public void testJobEntity() { - String jobId = UUID.randomUUID().toString(); - String processInstanceId = UUID.randomUUID().toString(); - - Job job1 = TestUtils - .createJob(jobId, processInstanceId, RandomStringUtils.randomAlphabetic(5), UUID.randomUUID().toString(), - RandomStringUtils.randomAlphabetic(10), "EXPECTED", 0L); - Job job2 = TestUtils - .createJob(jobId, processInstanceId, RandomStringUtils.randomAlphabetic(5), UUID.randomUUID().toString(), - RandomStringUtils.randomAlphabetic(10), "SCHEDULED", 1000L); - testStorage(jobId, job1, job2); - } - +public class JobStorageIT extends AbstractJobStorageIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessDefinitionStorageIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessDefinitionStorageIT.java index 5fe6e69c8d..627733c823 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessDefinitionStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessDefinitionStorageIT.java @@ -18,54 +18,13 @@ */ package org.kie.kogito.index.postgresql.storage; -import java.util.Set; - -import org.apache.commons.lang3.RandomStringUtils; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.model.ProcessDefinitionEntity; -import org.kie.kogito.index.jpa.model.ProcessDefinitionEntityRepository; -import org.kie.kogito.index.jpa.storage.ProcessDefinitionEntityStorage; -import org.kie.kogito.index.model.ProcessDefinition; -import org.kie.kogito.index.test.TestUtils; -import org.kie.kogito.persistence.api.StorageService; +import org.kie.kogito.index.jpa.storage.AbstractProcessDefinitionStorageIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -class ProcessDefinitionStorageIT extends AbstractStorageIT { - - @Inject - ProcessDefinitionEntityRepository repository; - - @Inject - StorageService storage; - - public ProcessDefinitionStorageIT() { - super(ProcessDefinition.class); - } - - @Override - public ProcessDefinitionEntityStorage.RepositoryAdapter getRepository() { - return new ProcessDefinitionEntityStorage.RepositoryAdapter(repository); - } - - @Override - public StorageService getStorage() { - return storage; - } - - @Test - void testProcessDefinitionEntity() { - String processId = RandomStringUtils.randomAlphabetic(10); - String version = "1.0"; - ProcessDefinition pdv1 = TestUtils.createProcessDefinition(processId, version, Set.of("admin", "kogito")); - ProcessDefinition pdv2 = TestUtils.createProcessDefinition(processId, version, Set.of("kogito")); - testStorage(pdv1.getKey(), pdv1, pdv2); - } - +class ProcessDefinitionStorageIT extends AbstractProcessDefinitionStorageIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java index 6b6b43d8fe..0ad8baf9b6 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/ProcessInstanceStorageIT.java @@ -18,37 +18,13 @@ */ package org.kie.kogito.index.postgresql.storage; -import java.util.UUID; - -import org.apache.commons.lang3.RandomStringUtils; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.model.ProcessInstanceEntityRepository; -import org.kie.kogito.index.model.ProcessInstanceState; -import org.kie.kogito.index.test.TestUtils; +import org.kie.kogito.index.jpa.storage.AbstractProcessInstanceStorageIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -public class ProcessInstanceStorageIT { - - @Inject - ProcessInstanceEntityRepository repository; - - @Test - public void testProcessInstanceEntity() { - String processInstanceId = UUID.randomUUID().toString(); - TestUtils - .createProcessInstance(processInstanceId, RandomStringUtils.randomAlphabetic(5), UUID.randomUUID().toString(), - RandomStringUtils.randomAlphabetic(10), ProcessInstanceState.ACTIVE.ordinal(), 0L); - TestUtils - .createProcessInstance(processInstanceId, RandomStringUtils.randomAlphabetic(5), UUID.randomUUID().toString(), - RandomStringUtils.randomAlphabetic(10), ProcessInstanceState.COMPLETED.ordinal(), 1000L); - - } - +public class ProcessInstanceStorageIT extends AbstractProcessInstanceStorageIT { } diff --git a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/UserTaskInstanceStorageIT.java b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/UserTaskInstanceStorageIT.java index 33e06afd01..4ada5a0753 100644 --- a/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/UserTaskInstanceStorageIT.java +++ b/data-index/data-index-storage/data-index-storage-postgresql/src/test/java/org/kie/kogito/index/postgresql/storage/UserTaskInstanceStorageIT.java @@ -18,38 +18,13 @@ */ package org.kie.kogito.index.postgresql.storage; -import java.util.UUID; - -import org.apache.commons.lang3.RandomStringUtils; -import org.junit.jupiter.api.Test; -import org.kie.kogito.index.jpa.model.UserTaskInstanceEntityRepository; -import org.kie.kogito.index.test.TestUtils; +import org.kie.kogito.index.jpa.storage.AbstractUserTaskInstanceStorageIT; import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource; import io.quarkus.test.common.QuarkusTestResource; import io.quarkus.test.junit.QuarkusTest; -import jakarta.inject.Inject; - @QuarkusTest @QuarkusTestResource(PostgreSqlQuarkusTestResource.class) -public class UserTaskInstanceStorageIT { - - @Inject - UserTaskInstanceEntityRepository repository; - - @Test - public void testUserTaskInstanceEntity() { - String taskId = UUID.randomUUID().toString(); - String processInstanceId = UUID.randomUUID().toString(); - TestUtils - .createUserTaskInstance(taskId, processInstanceId, RandomStringUtils.randomAlphabetic(5), - UUID.randomUUID().toString(), - RandomStringUtils.randomAlphabetic(10), "InProgress", 0L); - TestUtils - .createUserTaskInstance(taskId, processInstanceId, RandomStringUtils.randomAlphabetic(5), - UUID.randomUUID().toString(), - RandomStringUtils.randomAlphabetic(10), "Completed", 1000L); - } - +public class UserTaskInstanceStorageIT extends AbstractUserTaskInstanceStorageIT { } diff --git a/data-index/data-index-storage/pom.xml b/data-index/data-index-storage/pom.xml index f6a06bb1fc..e0f963655b 100644 --- a/data-index/data-index-storage/pom.xml +++ b/data-index/data-index-storage/pom.xml @@ -36,6 +36,11 @@ data-index-storage-api data-index-storage-protobuf data-index-storage-postgresql + data-index-storage-jpa-common + data-index-storage-common + data-index-storage-infinispan + data-index-storage-mongodb + data-index-storage-postgresql-reporting data-index-storage-jpa \ No newline at end of file diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/DataIndexOracleContainer.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/DataIndexOracleContainer.java deleted file mode 100644 index c6b7cc143a..0000000000 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/containers/DataIndexOracleContainer.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.test.containers; - -/** - * This container wraps Data Index Service container - */ -public class DataIndexOracleContainer extends AbstractDataIndexContainer { - public static final String NAME = "data-index-service-oracle"; - - public DataIndexOracleContainer() { - super(NAME); - } - - public void setDatabaseURL(String oracleURL, String username, String password) { - addEnv("QUARKUS_DATASOURCE_JDBC_URL", oracleURL); - addEnv("QUARKUS_DATASOURCE_USERNAME", username); - addEnv("QUARKUS_DATASOURCE_PASSWORD", password); - addEnv("QUARKUS_FLYWAY_MIGRATE_AT_START", "true"); - addEnv("QUARKUS_FLYWAY_BASELINE_ON_MIGRATE", "true"); - } - - @Override - public String getResourceName() { - return NAME; - } - -} diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpQuarkusTestResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpQuarkusTestResource.java deleted file mode 100644 index e72a31e8e8..0000000000 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpQuarkusTestResource.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.test.quarkus.http; - -import java.util.HashMap; -import java.util.Map; - -public class DataIndexOracleHttpQuarkusTestResource extends AbstractDataIndexHttpQuarkusTestResource { - - public DataIndexOracleHttpQuarkusTestResource() { - super(new DataIndexOracleHttpResource()); - } - - @Override - protected Map getProperties() { - Map properties = new HashMap<>(); - properties.putAll(getDataIndexConnectionProperties()); - properties.putAll(getTestResource().getProperties()); - return properties; - } - -} diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpResource.java deleted file mode 100644 index fc8f666f14..0000000000 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/http/DataIndexOracleHttpResource.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.test.quarkus.http; - -import java.util.HashMap; -import java.util.Map; - -import org.kie.kogito.index.test.containers.DataIndexOracleContainer; -import org.kie.kogito.test.resources.TestResource; -import org.kie.kogito.testcontainers.KogitoOracleSqlContainer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testcontainers.containers.Network; - -public class DataIndexOracleHttpResource implements TestResource { - - private static final Logger LOGGER = LoggerFactory.getLogger(DataIndexOracleHttpResource.class); - - KogitoOracleSqlContainer oracle = new KogitoOracleSqlContainer(); - DataIndexOracleContainer dataIndex = new DataIndexOracleContainer(); - Map properties = new HashMap<>(); - - @Override - public String getResourceName() { - return dataIndex.getResourceName(); - } - - @Override - public void start() { - LOGGER.debug("Starting Oracle Quarkus test resource"); - properties.clear(); - Network network = Network.newNetwork(); - oracle.withNetwork(network); - oracle.withNetworkAliases("oracle"); - oracle.withUsername("kogito"); - oracle.withPassword("kogito"); - oracle.start(); - - dataIndex.addProtoFileFolder(); - dataIndex.withNetwork(network); - dataIndex.setDatabaseURL("jdbc:oracle:thin:@oracle:1521/" + oracle.getDatabaseName(), - oracle.getUsername(), oracle.getPassword()); - dataIndex.addEnv("QUARKUS_PROFILE", "http-events-support"); - dataIndex.start(); - LOGGER.debug("Oracle Quarkus test resource started"); - } - - @Override - public void stop() { - dataIndex.stop(); - oracle.stop(); - LOGGER.debug("Oracle Quarkus test resource stopped"); - } - - @Override - public int getMappedPort() { - return dataIndex.getMappedPort(); - } - - public Map getProperties() { - return properties; - } -} diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java deleted file mode 100644 index 968ad34f5e..0000000000 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleKafkaResource.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.test.quarkus.kafka; - -import java.util.HashMap; -import java.util.Map; - -import org.kie.kogito.index.test.containers.DataIndexOracleContainer; -import org.kie.kogito.index.test.containers.KogitoKafkaContainerWithoutBridge; -import org.kie.kogito.test.resources.TestResource; -import org.kie.kogito.testcontainers.Constants; -import org.kie.kogito.testcontainers.KogitoOracleSqlContainer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testcontainers.containers.Network; -import org.testcontainers.containers.wait.strategy.Wait; - -public class DataIndexOracleKafkaResource implements TestResource { - - private static final Logger LOGGER = LoggerFactory.getLogger(DataIndexOracleKafkaResource.class); - - KogitoKafkaContainerWithoutBridge kafka = new KogitoKafkaContainerWithoutBridge(); - KogitoOracleSqlContainer oracle = new KogitoOracleSqlContainer(); - DataIndexOracleContainer dataIndex = new DataIndexOracleContainer(); - Map properties = new HashMap<>(); - - @Override - public String getResourceName() { - return dataIndex.getResourceName(); - } - - @Override - public void start() { - LOGGER.debug("Starting Oracle Quarkus test resource"); - properties.clear(); - Network network = Network.newNetwork(); - oracle.withNetwork(network); - oracle.withNetworkAliases("oracle"); - oracle.withUsername("kogito"); - oracle.withPassword("kogito"); - oracle.start(); - kafka.withNetwork(network); - kafka.withNetworkAliases("kafka"); - kafka.waitingFor(Wait.forListeningPort()).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT); - kafka.start(); - String kafkaURL = kafka.getBootstrapServers(); - properties.put("kafka.bootstrap.servers", kafkaURL); - properties.put("spring.kafka.bootstrap-servers", kafkaURL); - - dataIndex.addProtoFileFolder(); - dataIndex.withNetwork(network); - dataIndex.setDatabaseURL("jdbc:oracle:thin:@oracle:1521/" + oracle.getDatabaseName(), - oracle.getUsername(), oracle.getPassword()); - dataIndex.setKafkaURL("kafka:29092"); - dataIndex.addEnv("QUARKUS_PROFILE", "kafka-events-support"); - dataIndex.start(); - LOGGER.debug("Oracle Quarkus test resource started"); - } - - @Override - public void stop() { - dataIndex.stop(); - oracle.stop(); - kafka.stop(); - LOGGER.debug("Oracle Quarkus test resource stopped"); - } - - @Override - public int getMappedPort() { - return dataIndex.getMappedPort(); - } - - public Map getProperties() { - return properties; - } -} diff --git a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleQuarkusKafkaTestResource.java b/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleQuarkusKafkaTestResource.java deleted file mode 100644 index 1466378146..0000000000 --- a/data-index/data-index-test-utils/src/main/java/org/kie/kogito/index/test/quarkus/kafka/DataIndexOracleQuarkusKafkaTestResource.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.kie.kogito.index.test.quarkus.kafka; - -import java.util.HashMap; -import java.util.Map; - -import org.kie.kogito.test.resources.ConditionalQuarkusTestResource; - -import static org.kie.kogito.index.test.Constants.KOGITO_DATA_INDEX_SERVICE_URL; - -public class DataIndexOracleQuarkusKafkaTestResource extends ConditionalQuarkusTestResource { - public DataIndexOracleQuarkusKafkaTestResource() { - super(new DataIndexOracleKafkaResource()); - } - - @Override - protected Map getProperties() { - Map properties = new HashMap<>(); - properties.put(KOGITO_DATA_INDEX_SERVICE_URL, "http://localhost:" + getTestResource().getMappedPort()); - properties.putAll(getTestResource().getProperties()); - return properties; - } - -} diff --git a/kogito-apps-bom/pom.xml b/kogito-apps-bom/pom.xml index 9bdc29b0d9..044ba56f01 100644 --- a/kogito-apps-bom/pom.xml +++ b/kogito-apps-bom/pom.xml @@ -1,4 +1,3 @@ - - - - data-index-service - org.kie.kogito - 9.99.0 - - 4.0.0 - - data-index-service-oracle - Kogito Apps :: Data Index Service with Oracle - - - org.kie.kogito.index.service.oracle - - - - - org.kie.kogito - data-index-service-common - - - org.kie.kogito - data-index-storage-oracle - - - io.quarkus - quarkus-smallrye-reactive-messaging-kafka - - - io.quarkus - quarkus-container-image-jib - - - io.quarkus - quarkus-flyway - - - - org.kie.kogito - data-index-test-utils - test - - - org.kie.kogito - data-index-service-common - test-jar - test - - - io.quarkus - quarkus-junit5 - test - - - io.rest-assured - rest-assured - test - - - org.mockito - mockito-junit-jupiter - test - - - org.assertj - assertj-core - test - - - org.kie.kogito - kogito-quarkus-test-utils - test - - - org.keycloak - keycloak-core - test - - - org.awaitility - awaitility - test - - - io.smallrye.reactive - smallrye-reactive-messaging-in-memory - test - - - - - - - io.quarkus - quarkus-maven-plugin - - true - - - - - build - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - integration-test - - integration-test - verify - - - - - - - \ No newline at end of file diff --git a/data-index/data-index-service/pom.xml b/data-index/data-index-service/pom.xml index fe242f2029..23283ff121 100644 --- a/data-index/data-index-service/pom.xml +++ b/data-index/data-index-service/pom.xml @@ -35,11 +35,6 @@ data-index-service-common data-index-service-inmemory data-index-service-postgresql -<<<<<<< 9.99.x-prod -======= - data-index-service-infinispan - data-index-service-mongodb ->>>>>>> b6ece5b Removing oracle driver and associated tests (#1971) diff --git a/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml b/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml index d9d262ac0f..061ed01c10 100644 --- a/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml +++ b/data-index/data-index-storage/data-index-storage-jpa-common/pom.xml @@ -25,7 +25,7 @@ org.kie.kogito data-index-storage - 999-SNAPSHOT + 9.99.0 4.0.0 diff --git a/data-index/data-index-storage/data-index-storage-oracle/pom.xml b/data-index/data-index-storage/data-index-storage-oracle/pom.xml deleted file mode 100644 index 2873f885be..0000000000 --- a/data-index/data-index-storage/data-index-storage-oracle/pom.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - org.kie.kogito - data-index-storage - 9.99.0 - - 4.0.0 - - data-index-storage-oracle - Kogito Apps :: Data Index Storage Oracle DB - - - org.kie.kogito.index.oracle - - - - - org.kie.kogito - data-index-storage-jpa - - - io.quarkus - quarkus-jdbc-oracle - - - org.kie.kogito - data-index-storage-api - test-jar - test - - - io.quarkus - quarkus-junit5-mockito - test - - - org.assertj - assertj-core - test - - - org.mockito - mockito-junit-jupiter - test - - - org.kie.kogito - kogito-quarkus-test-utils - test - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - org.jboss.logmanager.LogManager - - - - - test - - integration-test - verify - - - - - - - - - - schema - - - generate.schema - - - - - - org.codehaus.mojo - exec-maven-plugin - - - package - - exec - - - - - java - - -classpath - - - org.kie.kogito.index.oracle.schema.DDLSchemaExporter - - test - - - - - - - - \ No newline at end of file diff --git a/data-index/data-index-storage/pom.xml b/data-index/data-index-storage/pom.xml index e0f963655b..9c758c084d 100644 --- a/data-index/data-index-storage/pom.xml +++ b/data-index/data-index-storage/pom.xml @@ -37,10 +37,5 @@ data-index-storage-protobuf data-index-storage-postgresql data-index-storage-jpa-common - data-index-storage-common - data-index-storage-infinispan - data-index-storage-mongodb - data-index-storage-postgresql-reporting - data-index-storage-jpa \ No newline at end of file