diff --git a/build.gradle b/build.gradle index 029b7a2d16..1ea2fedfe0 100644 --- a/build.gradle +++ b/build.gradle @@ -68,7 +68,7 @@ dependencies { implementation 'com.epam.reportportal:commons' implementation 'com.epam.reportportal:plugin-api:5.11.1' } else { - implementation 'com.github.reportportal:commons-dao:bad7959' + implementation 'com.github.reportportal:commons-dao:2963fbe' implementation 'com.github.reportportal:commons:d4be022' implementation 'com.github.reportportal:plugin-api:d1c0f0e' } diff --git a/src/main/java/com/epam/ta/reportportal/core/integration/impl/CreateIntegrationHandlerImpl.java b/src/main/java/com/epam/ta/reportportal/core/integration/impl/CreateIntegrationHandlerImpl.java index 8884abbf6f..42c0748e57 100644 --- a/src/main/java/com/epam/ta/reportportal/core/integration/impl/CreateIntegrationHandlerImpl.java +++ b/src/main/java/com/epam/ta/reportportal/core/integration/impl/CreateIntegrationHandlerImpl.java @@ -89,7 +89,7 @@ public EntryCreatedRS createGlobalIntegration(IntegrationRQ createRequest, Strin ); String integrationName = - ofNullable(createRequest.getName()).map(String::toLowerCase).map(name -> { + ofNullable(createRequest.getName()).map(name -> { validateGlobalIntegrationName(name, integrationType); return name; }).orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_INTEGRATION_NAME, @@ -122,11 +122,12 @@ public EntryCreatedRS createProjectIntegration(String projectName, IntegrationRQ this.basicIntegrationService ); - String integrationName = - ofNullable(createRequest.getName()).map(String::toLowerCase).map(name -> { + String integrationName = ofNullable(createRequest.getName()) + .map(name -> { validateProjectIntegrationName(name, integrationType, project); return name; - }).orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_INTEGRATION_NAME, + }) + .orElseThrow(() -> new ReportPortalException(ErrorType.INCORRECT_INTEGRATION_NAME, "Integration name should be not null" )); createRequest.setName(integrationName); @@ -151,7 +152,7 @@ public OperationCompletionRS updateGlobalIntegration(Long id, IntegrationRQ upda IntegrationActivityResource beforeUpdate = TO_ACTIVITY_RESOURCE.apply(integration); - ofNullable(updateRequest.getName()).map(String::toLowerCase).ifPresent(name -> { + ofNullable(updateRequest.getName()).ifPresent(name -> { if (!name.equals(integration.getName())) { validateGlobalIntegrationName(name, integration.getType()); } @@ -186,7 +187,7 @@ public OperationCompletionRS updateProjectIntegration(Long id, String projectNam IntegrationActivityResource beforeUpdate = TO_ACTIVITY_RESOURCE.apply(integration); - ofNullable(updateRequest.getName()).map(String::toLowerCase).ifPresent(name -> { + ofNullable(updateRequest.getName()).ifPresent(name -> { if (!name.equals(integration.getName())) { validateProjectIntegrationName(name, integration.getType(), project); } @@ -215,7 +216,7 @@ private void validateGlobalIntegrationName(String integrationName, BusinessRule.expect(integrationName, StringUtils::isNotBlank) .verify(ErrorType.INCORRECT_INTEGRATION_NAME, "Integration name should be not empty"); BusinessRule.expect( - integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull(integrationName, + integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectIdIsNull(integrationName, integrationType.getId() ), BooleanUtils::isFalse).verify(ErrorType.INTEGRATION_ALREADY_EXISTS, Suppliers.formattedSupplier( @@ -229,7 +230,7 @@ private void validateProjectIntegrationName(String integrationName, IntegrationType integrationType, Project project) { BusinessRule.expect(integrationName, StringUtils::isNotBlank) .verify(ErrorType.INCORRECT_INTEGRATION_NAME, "Integration name should be not empty"); - BusinessRule.expect(integrationRepository.existsByNameAndTypeIdAndProjectId(integrationName, + BusinessRule.expect(integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectId(integrationName, integrationType.getId(), project.getId() ), BooleanUtils::isFalse).verify(ErrorType.INTEGRATION_ALREADY_EXISTS, Suppliers.formattedSupplier(