Skip to content

Commit

Permalink
using proposerEmail in the list method
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-lg committed May 20, 2021
1 parent f502292 commit d3e63ab
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,18 @@ public void listChangeSuggestionTest() {
Status status = Status.PENDING;
Type type = Type.CREATE;
Country country = Country.DENMARK;
String proposedBy = "aa@aa.com";
String proposerEmail = "aa@aa.com";
UUID entityKey = UUID.randomUUID();
Pageable page = new PagingRequest();

when(getMockChangeSuggestionService().list(status, type, country, proposedBy, entityKey, page))
when(getMockChangeSuggestionService().list(status, type, country, proposerEmail, entityKey, page))
.thenReturn(
new PagingResponse<>(
new PagingRequest(), 1L, Collections.singletonList(changeSuggestion)));

PagingResponse<R> result =
getPrimaryCollectionEntityClient()
.listChangeSuggestion(status, type, country, proposedBy, entityKey, page);
.listChangeSuggestion(status, type, country, proposerEmail, entityKey, page);
assertEquals(1, result.getResults().size());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ List<ChangeSuggestionDto> list(
@Param("type") Type type,
@Param("collectionEntityType") CollectionEntityType collectionEntityType,
@Param("country") Country country,
@Param("proposer") String proposer,
@Param("proposerEmail") String proposerEmail,
@Param("entityKey") UUID entityKey,
@Nullable @Param("page") Pageable page);

Expand All @@ -36,7 +36,7 @@ long count(
@Param("type") Type type,
@Param("collectionEntityType") CollectionEntityType collectionEntityType,
@Param("country") Country country,
@Param("proposer") String proposer,
@Param("proposerEmail") String proposerEmail,
@Param("entityKey") UUID entityKey);

void update(ChangeSuggestionDto suggestion);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
<if test="country != null">
AND cs.country = #{country,jdbcType=VARCHAR}
</if>
<if test="proposer != null">
AND cs.proposed_by = #{proposer,jdbcType=OTHER}
<if test="proposerEmail != null">
AND cs.proposer_email = #{proposerEmail,jdbcType=OTHER}
</if>
<if test="entityKey != null">
AND cs.entity_key = #{entityKey,jdbcType=OTHER}
Expand Down Expand Up @@ -113,8 +113,8 @@
<if test="country != null">
AND cs.country = #{country,jdbcType=VARCHAR}
</if>
<if test="proposer != null">
AND cs.proposed_by = #{proposer,jdbcType=OTHER}
<if test="proposerEmail != null">
AND cs.proposer_email = #{proposerEmail,jdbcType=OTHER}
</if>
<if test="entityKey != null">
AND cs.entity_key = #{entityKey,jdbcType=OTHER}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public PagingResponse<R> list(
@Nullable Status status,
@Nullable Type type,
@Nullable Country country,
@Nullable String proposedBy,
@Nullable String proposerEmail,
@Nullable UUID entityKey,
@Nullable Pageable pageable) {
Pageable page = pageable == null ? new PagingRequest() : pageable;
Expand All @@ -311,7 +311,7 @@ public PagingResponse<R> list(
type,
collectionEntityType,
country,
newEmptyChangeSuggestion().getProposedBy(),
proposerEmail,
entityKey,
page);

Expand All @@ -321,7 +321,7 @@ public PagingResponse<R> list(
type,
collectionEntityType,
country,
newEmptyChangeSuggestion().getProposedBy(),
proposerEmail,
entityKey);

List<R> changeSuggestions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ PagingResponse<R> listChangeSuggestion(
@RequestParam(value = "status", required = false) Status status,
@RequestParam(value = "type", required = false) Type type,
@RequestParam(value = "country") Country country,
@RequestParam(value = "proposedBy", required = false) String proposedBy,
@RequestParam(value = "proposerEmail", required = false) String proposerEmail,
@RequestParam(value = "entityKey", required = false) UUID entityKey,
@SpringQueryMap Pageable page);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ public PagingResponse<R> listChangeSuggestion(
@RequestParam(value = "status", required = false) Status status,
@RequestParam(value = "type", required = false) Type type,
Country country,
@RequestParam(value = "proposedBy", required = false) String proposedBy,
@RequestParam(value = "proposerEmail", required = false) String proposerEmail,
@RequestParam(value = "entityKey", required = false) UUID entityKey,
Pageable page) {
return changeSuggestionService.list(status, type, country, proposedBy, entityKey, page);
return changeSuggestionService.list(status, type, country, proposerEmail, entityKey, page);
}

@PutMapping(value = "changeSuggestion/{key}/discard")
Expand Down

0 comments on commit d3e63ab

Please sign in to comment.