Skip to content

Commit

Permalink
altered test files to change to List<String> for category nad orgUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzgrewal committed Nov 4, 2024
1 parent d25c114 commit eae7a06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class OpeningSearchRepositoryTest {
private OpeningSearchRepository openingSearchRepository;

private OpeningSearchFiltersDto mockFilter(
String orgUnit,
String category,
List<String> orgUnit,
List<String> category,
List<String> statusList,
Boolean myOpenings,
Boolean submittedToFrpa,
Expand Down Expand Up @@ -79,16 +79,16 @@ private OpeningSearchFiltersDto mockFilter(
mainSearchTerm);
}

private OpeningSearchFiltersDto mockOrgUnit(String orgUnit) {
private OpeningSearchFiltersDto mockOrgUnit(List<String> orgUnit) {
return mockFilter(
orgUnit, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null);
}

private OpeningSearchFiltersDto mockAllFilters() {
return mockFilter(
"DCR",
"FTML",
List.of("DCR"),
List.of("FTML"),
List.of("APP"),
true,
false,
Expand Down Expand Up @@ -481,7 +481,7 @@ void searchOpeningQuery_mainFilterString_shouldSucceed() {
@Test
@DisplayName("Search opening query org unit filter should succeed")
void searchOpeningQuery_orgUnitFilter_shouldSucceed() {
OpeningSearchFiltersDto filters = mockOrgUnit("DCR");
OpeningSearchFiltersDto filters = mockOrgUnit(List.of("DCR"));

PaginationParameters pagination = new PaginationParameters(0, 10);

Expand Down Expand Up @@ -575,15 +575,15 @@ void searchOpeningQuery_allFilters_shouldSucceed() {

Integer openingId = 123456789;
String openingNumber = "589";
OpeningCategoryEnum category = OpeningCategoryEnum.of(filters.getCategory());
OpeningCategoryEnum category = OpeningCategoryEnum.of("FTML");
OpeningStatusEnum status = OpeningStatusEnum.of(filters.getStatusList().get(0));
String cuttingPermitId = "123";
String timberMark = "EM2184";
String cutBlockId = "456";
BigDecimal openingGrossArea = new BigDecimal("11");
Timestamp disturbanceStartDate = Timestamp.valueOf(LocalDateTime.now());
String forestFileId = "TFL47";
String orgUnitCode = filters.getOrgUnit();
String orgUnitCode = "DCR";
String orgUnitName = "Org Name";
String clientNumber = "00012797";
String clientLocation = "00";
Expand Down Expand Up @@ -655,7 +655,7 @@ void searchOpeningQuery_allFilters_shouldSucceed() {
@Test
@DisplayName("Search opening query no records found should succeed")
void searchOpeningQuery_noRecordsFound_shouldSucceed() {
OpeningSearchFiltersDto filters = mockOrgUnit("AAA");
OpeningSearchFiltersDto filters = mockOrgUnit(List.of("AAA"));

PaginationParameters pagination = new PaginationParameters(0, 10);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import com.github.tomakehurst.wiremock.junit5.WireMockExtension;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -153,7 +155,7 @@ void openingSearch_orgUnit_shouldSucceed() {

PaginatedResult<OpeningSearchResponseDto> result =
openingService.openingSearch(new OpeningSearchFiltersDto(
"TWO",
List.of("TWO"),
null,
null,
null,
Expand Down

0 comments on commit eae7a06

Please sign in to comment.