mirror of
https://github.com/valitydev/org-manager.git
synced 2024-11-06 08:25:21 +00:00
Merge pull request #39 from rbkmoney/ft/bouncer_context
add party in bouncer context
This commit is contained in:
commit
f45ee31f53
@ -30,6 +30,7 @@ public class BouncerContextConverter {
|
|||||||
return new Organization()
|
return new Organization()
|
||||||
.setId(entity.getId())
|
.setId(entity.getId())
|
||||||
.setOwner(new Entity().setId(entity.getOwner()))
|
.setOwner(new Entity().setId(entity.getOwner()))
|
||||||
|
.setParty(new Entity().setId(entity.getId()))
|
||||||
.setRoles(CollectionUtils.isEmpty(roles) ? null :
|
.setRoles(CollectionUtils.isEmpty(roles) ? null :
|
||||||
roles.stream()
|
roles.stream()
|
||||||
.filter(memberRoleEntity -> memberRoleEntity.getOrganizationId().equals(entity.getId()))
|
.filter(memberRoleEntity -> memberRoleEntity.getOrganizationId().equals(entity.getId()))
|
||||||
|
@ -81,6 +81,7 @@ class BouncerContextConverterTest {
|
|||||||
|
|
||||||
assertEquals(organizationEntity.getId(), organization.getId());
|
assertEquals(organizationEntity.getId(), organization.getId());
|
||||||
assertEquals(organizationEntity.getOwner(), organization.getOwner().getId());
|
assertEquals(organizationEntity.getOwner(), organization.getOwner().getId());
|
||||||
|
assertEquals(organizationEntity.getId(), organization.getParty().getId());
|
||||||
assertTrue(organization.getRoles().isEmpty());
|
assertTrue(organization.getRoles().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,6 +95,7 @@ class BouncerContextConverterTest {
|
|||||||
|
|
||||||
assertEquals(organizationEntity.getId(), organization.getId());
|
assertEquals(organizationEntity.getId(), organization.getId());
|
||||||
assertEquals(organizationEntity.getOwner(), organization.getOwner().getId());
|
assertEquals(organizationEntity.getOwner(), organization.getOwner().getId());
|
||||||
|
assertEquals(organizationEntity.getId(), organization.getParty().getId());
|
||||||
assertEquals(memberRoleEntity.getRoleId(), organization.getRoles().iterator().next().getId());
|
assertEquals(memberRoleEntity.getRoleId(), organization.getRoles().iterator().next().getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user