Skip to content

Commit

Permalink
EPMRPP-90911 make integration search case-insensitive (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx authored Aug 23, 2024
1 parent bad7959 commit 2963fbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit 2963fbe

Please sign in to comment.