-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix:API-paging Updating converter classes and adding tests for paging * Adding tests Added test to HousekeepingMetadataResponseTest to ensure paging works with multiple pages and elements add another test where these values are not the default ones (more than 1 page and total num of elements is higher than the page size) * Update BeekeeperApiIntegrationTest.java * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Andreea Paduraru <[email protected]> * [maven-release-plugin] prepare release beekeeper-parent-3.5.5 * [maven-release-plugin] prepare for next development iteration * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Update pom.xml * Remove surplus comments * Update CHANGELOG.md * Update CHANGELOG.md * Update beekeeper-api/src/test/java/com/expediagroup/beekeeper/api/response/PathResponseConverterTest.java * Update beekeeper-api/src/main/java/com/expediagroup/beekeeper/api/response/PathResponseConverter.java Co-authored-by: Abhimanyu Gupta <[email protected]> * Update MetadataResponseConverter.java * Update PathResponseConverter.java * Update CHANGELOG.md * Update BeekeeperApiIntegrationTest.java Extracting sections as code constants * Update BeekeeperApiIntegrationTest.java * Update BeekeeperApiIntegrationTest.java Remove comment from Integration test * Update BeekeeperApiIntegrationTest.java Remove comment from Integration test * Refactoring tests * Update beekeeper-integration-tests/src/test/java/com/expediagroup/beekeeper/integration/api/BeekeeperApiIntegrationTest.java Co-authored-by: Andreea Paduraru <[email protected]> * Refactoring tests --------- Co-authored-by: Hamza Jugon <[email protected]> Co-authored-by: Andreea Paduraru <[email protected]> Co-authored-by: eg-oss-ci <[email protected]> Co-authored-by: Abhimanyu Gupta <[email protected]>
- Loading branch information
1 parent
20db8ad
commit 9912e0e
Showing
7 changed files
with
189 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...-api/src/test/java/com/expediagroup/beekeeper/api/response/PathResponseConverterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright (C) 2019-2023 Expedia, Inc. | ||
* | ||
* Licensed 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 com.expediagroup.beekeeper.api.response; | ||
|
||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat; | ||
|
||
import static com.expediagroup.beekeeper.api.response.PathResponseConverter.convertToHousekeepingPathResponsePage; | ||
import static com.expediagroup.beekeeper.api.util.DummyHousekeepingEntityGenerator.generateDummyHousekeepingPath; | ||
import static com.expediagroup.beekeeper.api.util.DummyHousekeepingEntityGenerator.generateDummyHousekeepingPathResponse; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.PageImpl; | ||
|
||
import com.expediagroup.beekeeper.core.model.HousekeepingPath; | ||
|
||
public class PathResponseConverterTest { | ||
|
||
@Test | ||
public void testConvertToHousekeepingPathResponsePage() { | ||
HousekeepingPath housekeepingPath1 = generateDummyHousekeepingPath("some_database1", "some_table1"); | ||
HousekeepingPath housekeepingPath2 = generateDummyHousekeepingPath("some_database2", "some_table2"); | ||
HousekeepingPathResponse housekeepingPathResponse1 = generateDummyHousekeepingPathResponse(housekeepingPath1); | ||
HousekeepingPathResponse housekeepingPathResponse2 = generateDummyHousekeepingPathResponse(housekeepingPath2); | ||
|
||
List<HousekeepingPath> housekeepingPathList = List.of(housekeepingPath1, housekeepingPath2); | ||
Page<HousekeepingPathResponse> housekeepingPathResponsePage = convertToHousekeepingPathResponsePage( | ||
new PageImpl<>(housekeepingPathList)); | ||
|
||
List<HousekeepingPathResponse> housekeepingPathResponsePageList = housekeepingPathResponsePage.getContent(); | ||
|
||
assertThat(housekeepingPathResponsePageList.get(0)).isEqualTo(housekeepingPathResponse1); | ||
assertThat(housekeepingPathResponsePageList.get(1)).isEqualTo(housekeepingPathResponse2); | ||
assertThat(housekeepingPathResponsePage.getTotalElements()).isEqualTo(2L); | ||
assertThat(housekeepingPathResponsePage.getTotalPages()).isEqualTo(1L); | ||
assertThat(housekeepingPathResponsePage.getPageable()).isEqualTo((new PageImpl<>(housekeepingPathList).getPageable())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.