Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisKina-dev committed Jan 10, 2025
1 parent ff3edbe commit 7672652
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class IamUserInfoDTO {
private String name;
private String issuer;
private IamUserOrganizationRolesDTO organizationAccess;
private Long brokerId;

// field calculated upon registration
private String innerUserId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ private UserInfo systemUserMapper(IamUserInfoDTO iamUserInfoDTO) {
.organizationIpaCode(organizationIpaCode)
.roles(Collections.singletonList(Constants.ROLE_ADMIN))
.build()))
.brokerId(iamUserInfoDTO.getBrokerId())
.build();
}

Expand Down Expand Up @@ -88,6 +89,7 @@ private UserInfo userInfoMapper(IamUserInfoDTO iamUserInfoDTO, String accessToke
.email(r.getEmail())
.build())
.toList())
.brokerId(iamUserInfoDTO.getBrokerId())
.build();

if (iamUserInfoDTO.getOrganizationAccess() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ void givenDTOWhenApplyTheOk() {
IamUserInfoDTO result = mapper.apply(clientDTO);
//Then
Assertions.assertEquals(iamUserInfoDTO, result);
TestUtils.checkNotNullFields(result, "innerUserId");
TestUtils.checkNotNullFields(result, "innerUserId", "brokerId");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void givenCompleteDataWhenApplyThenOk() {
.organizationIpaCode("ORG")
.email("EMAIL")
.build())
.brokerId(1L)
.build();

User user = User.builder()
Expand Down Expand Up @@ -109,6 +110,7 @@ void givenCompleteDataWhenApplyThenOk() {
.roles(List.of("ROLE"))
.email("EMAIL")
.build()))
.brokerId(1L)
.canManageUsers(!organizationAccessMode)
.build();

Expand Down Expand Up @@ -139,6 +141,7 @@ void givenNotOperatorsWhenApplyThenOk() {
.organizationIpaCode("ORG")
.email("EMAIL")
.build())
.brokerId(1L)
.build();

User user = User.builder()
Expand All @@ -155,6 +158,7 @@ void givenNotOperatorsWhenApplyThenOk() {
.issuer("ISSUER")
.organizationAccess("ORG")
.organizations(Collections.emptyList())
.brokerId(1L)
.canManageUsers(!organizationAccessMode)
.build();

Expand All @@ -179,6 +183,7 @@ void givenNoOrganizationAccessWhenApplyThenOk() {
.familyName("FAMILYNAME")
.name("NAME")
.issuer("ISSUER")
.brokerId(1L)
.build();

User user = User.builder()
Expand Down Expand Up @@ -206,6 +211,7 @@ void givenNoOrganizationAccessWhenApplyThenOk() {
.roles(List.of("ROLE"))
.email("EMAIL")
.build()))
.brokerId(1L)
.canManageUsers(!organizationAccessMode)
.build();

Expand Down Expand Up @@ -235,6 +241,7 @@ void givenSystemUserWhenApplyThenOk() {
.organizationIpaCode("IPA_CODE")
.roles(Collections.singletonList(Constants.ROLE_ADMIN))
.build())
.brokerId(1L)
.build();

UserInfo expected = UserInfo.builder()
Expand All @@ -248,6 +255,7 @@ void givenSystemUserWhenApplyThenOk() {
.organizationIpaCode("IPA_CODE")
.roles(List.of(Constants.ROLE_ADMIN))
.build()))
.brokerId(1L)
.build();

// When
Expand Down

0 comments on commit 7672652

Please sign in to comment.