Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EPMRPP-90911 make integration search case-insensitive #1033

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
public interface IntegrationRepository extends ReportPortalRepository<Integration, Long>,
IntegrationRepositoryCustom {

boolean existsByNameAndTypeIdAndProjectIdIsNull(String name, Long typeId);
boolean existsByNameIgnoreCaseAndTypeIdAndProjectIdIsNull(String name, Long typeId);

boolean existsByNameAndTypeIdAndProjectId(String name, Long typeId, Long projectId);
boolean existsByNameIgnoreCaseAndTypeIdAndProjectId(String name, Long typeId, Long projectId);

/**
* Retrieve integration by ID and project ID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,25 +164,27 @@ void findAllGlobal() {

@Test
void existsByNameTypePositive() {
boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull("jira", 6L);
boolean exists = integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectIdIsNull("jira", 6L);
assertTrue(exists);
}

@Test
void existsByNameTypeNegative() {
boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectIdIsNull("jira1", 4L);
boolean exists = integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectIdIsNull("jira1", 4L);
assertFalse(exists);
}

@Test
void existsByNameTypeProjectIdPositive() {
boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectId("jira1", 6L, 1L);
boolean exists = integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectId("jira1", 6L, 1L);
assertTrue(exists);
exists = integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectId("JiRa1", 6L, 1L);
assertTrue(exists);
}

@Test
void existsByNameTypeProjectIdNegative() {
boolean exists = integrationRepository.existsByNameAndTypeIdAndProjectId("jira", 6L, 2L);
boolean exists = integrationRepository.existsByNameIgnoreCaseAndTypeIdAndProjectId("jira", 6L, 2L);
assertFalse(exists);
}

Expand Down
Loading