Skip to content

Commit

Permalink
modify partyRole return type to String
Browse files Browse the repository at this point in the history
  • Loading branch information
giulia-tremolada committed Jun 10, 2024
1 parent 34a9a88 commit 8aaf25f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static ProductRoleMappingsResource toProductRoleMappingsResource(Map.Entry<Party
ProductRoleMappingsResource resource = null;
if (entry != null) {
resource = new ProductRoleMappingsResource();
resource.setPartyRole(entry.getKey());
resource.setPartyRole(entry.getKey().name());
resource.setSelcRole(entry.getKey() != PartyRole.OPERATOR ? SelfCareAuthority.ADMIN : SelfCareAuthority.LIMITED);
resource.setMultiroleAllowed(entry.getValue().isMultiroleAllowed());
if (entry.getValue().getRoles() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.swagger.annotations.ApiModelProperty;
import it.pagopa.selfcare.commons.base.security.SelfCareAuthority;
import it.pagopa.selfcare.onboarding.common.PartyRole;
import lombok.Data;
import lombok.EqualsAndHashCode;

Expand All @@ -12,7 +11,7 @@
public class ProductRoleMappingsResource {

@ApiModelProperty(value = "${swagger.dashboard.product-role-mappings.model.partyRole}")
private PartyRole partyRole;
private String partyRole;

@ApiModelProperty(value = "${swagger.dashboard.product-role-mappings.model.selcRole}")
private SelfCareAuthority selcRole;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void toProductRoleMappingsResource_fromEntry_notNull() {
assertNotNull(output);
assertNotNull(output.getProductRoles());
assertEquals(productRoleInfo.getRoles().size(), output.getProductRoles().size());
assertEquals(input.getKey(), output.getPartyRole());
assertEquals(input.getKey().name(), output.getPartyRole());
assertEquals(SelfCareAuthority.ADMIN, output.getSelcRole());
assertEquals(input.getValue().isMultiroleAllowed(), output.isMultiroleAllowed());
}
Expand Down

0 comments on commit 8aaf25f

Please sign in to comment.