Skip to content

Commit

Permalink
feature(chore):962 extended autocomplete api by contractAgreementId
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-mwesener committed Jun 24, 2024
1 parent b2690d9 commit 7e63995
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- #962 Adapt cucumber test to include the mandatory attributes for creating a quality notification
- #753 Refactored message history in notification detail view
- XXX updated local deployment documentation
- #1037 extended autocomplete api by contractAgreementId

### Added
- #832 added policymanagement list view, creator and editor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public class AssetAsBuiltFieldMapper extends BaseRequestFieldMapper {
Map.entry("receivedQualityAlertIdsInStatusActive", "receivedActiveAlerts"),
Map.entry("receivedQualityInvestigationIdsInStatusActive", "receivedActiveInvestigations"),
Map.entry("importState", "importState"),
Map.entry("importNote", "importNote")
Map.entry("importNote", "importNote"),
Map.entry("contractAgreementId", "contractAgreementId")
);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public class AssetAsPlannedFieldMapper extends BaseRequestFieldMapper {
Map.entry("businessPartner", "manufacturerId"),
Map.entry("van", "van"),
Map.entry("importState", "importState"),
Map.entry("importNote", "importNote")
Map.entry("importNote", "importNote"),
Map.entry("contractAgreementId", "contractAgreementId")

);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,36 @@ void givenBusinessPartnerLowercase_whenCallDistinctFilterValues_thenProperRespon
"BPNL00000003B5MJ"));
}

@Test
void givenContractAgreementId_whenCallDistinctFilterValues_thenProperResponse() throws JoseException {
// given
assetsSupport.defaultAssetsStored();
String fieldName = "contractAgreementId";
String resultLimit = "100";
String startWith = "abc1";

// then
given()
.header(oAuth2Support.jwtAuthorization(ADMIN))
.contentType(ContentType.JSON)
.log().all()
.when()
.param("fieldName", fieldName)
.param("size", resultLimit)
.param("startWith", startWith)
.get("/api/assets/as-built/distinctFilterValues")
.then()
.log().all()
.statusCode(200)
.assertThat()
.body(".", Matchers.containsInRelativeOrder(
"abc1",
"abc10",
"abc11",
"abc12",
"abc13"));
}

@Test
void givenBusinessPartnerMixedCase_whenCallDistinctFilterValues_thenProperResponse() throws JoseException {
// given
Expand Down

0 comments on commit 7e63995

Please sign in to comment.