Array.fromFormatted
This commit is contained in:
parent
639925e834
commit
de0c8dcfbc
@ -112,14 +112,17 @@ class HsOfficeBankAccountRepositoryIntegrationTest extends ContextBasedTest {
|
||||
"hs_office_bankaccount#sometempaccC.admin",
|
||||
"hs_office_bankaccount#sometempaccC.tenant"
|
||||
));
|
||||
assertThat(grantDisplaysOf(rawGrantRepo.findAll())).containsExactlyInAnyOrder(Array.from(
|
||||
assertThat(grantDisplaysOf(rawGrantRepo.findAll())).containsExactlyInAnyOrder(Array.fromFormatted(
|
||||
initialGrantNames,
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.owner to role global#global.admin by system and assume }",
|
||||
"{ grant perm delete on hs_office_bankaccount#sometempaccC to role hs_office_bankaccount#sometempaccC.owner by system and assume }",
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.tenant to role hs_office_bankaccount#sometempaccC.admin by system and assume }",
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.admin to role hs_office_bankaccount#sometempaccC.owner by system and assume }",
|
||||
"{ grant perm view on hs_office_bankaccount#sometempaccC to role hs_office_bankaccount#sometempaccC.tenant by system and assume }",
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.owner to user selfregistered-user-drew@hostsharing.org by global#global.admin and assume }"
|
||||
"{ grant perm delete on hs_office_bankaccount#sometempaccC to role hs_office_bankaccount#sometempaccC.owner by system and assume }",
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.owner to role global#global.admin by system and assume }",
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.owner to user selfregistered-user-drew@hostsharing.org by global#global.admin and assume }",
|
||||
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.admin to role hs_office_bankaccount#sometempaccC.owner by system and assume }",
|
||||
|
||||
"{ grant perm view on hs_office_bankaccount#sometempaccC to role hs_office_bankaccount#sometempaccC.tenant by system and assume }",
|
||||
"{ grant role hs_office_bankaccount#sometempaccC.tenant to role hs_office_bankaccount#sometempaccC.admin by system and assume }",
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ class HsOfficeDebitorRepositoryIntegrationTest extends ContextBasedTest {
|
||||
"hs_office_debitor#20002Fourthe.G.-forthcontact.admin",
|
||||
"hs_office_debitor#20002Fourthe.G.-forthcontact.owner",
|
||||
"hs_office_debitor#20002Fourthe.G.-forthcontact.tenant"));
|
||||
assertThat(grantDisplaysOf(rawGrantRepo.findAll())).containsExactlyInAnyOrder(Array.fromSkippingNull(
|
||||
assertThat(grantDisplaysOf(rawGrantRepo.findAll())).containsExactlyInAnyOrder(Array.fromFormatted(
|
||||
initialGrantNames,
|
||||
"{ grant perm * on hs_office_debitor#20002Fourthe.G.-forthcontact to role hs_office_debitor#20002Fourthe.G.-forthcontact.owner by system and assume }",
|
||||
"{ grant role hs_office_debitor#20002Fourthe.G.-forthcontact.owner to role global#global.admin by system and assume }",
|
||||
|
@ -121,7 +121,7 @@ class HsOfficeRelationshipRepositoryIntegrationTest extends ContextBasedTest {
|
||||
"hs_office_relationship#BesslerAnita-with-JOINT_AGENT-BesslerAnita.admin",
|
||||
"hs_office_relationship#BesslerAnita-with-JOINT_AGENT-BesslerAnita.owner",
|
||||
"hs_office_relationship#BesslerAnita-with-JOINT_AGENT-BesslerAnita.tenant"));
|
||||
assertThat(grantDisplaysOf(rawGrantRepo.findAll())).containsExactlyInAnyOrder(Array.fromSkippingNull(
|
||||
assertThat(grantDisplaysOf(rawGrantRepo.findAll())).containsExactlyInAnyOrder(Array.fromFormatted(
|
||||
initialGrantNames,
|
||||
|
||||
"{ grant perm * on hs_office_relationship#BesslerAnita-with-JOINT_AGENT-BesslerAnita to role hs_office_relationship#BesslerAnita-with-JOINT_AGENT-BesslerAnita.owner by system and assume }",
|
||||
|
@ -22,7 +22,7 @@ public class Array {
|
||||
return resultList.toArray(String[]::new);
|
||||
}
|
||||
|
||||
public static String[] fromSkippingNull(final List<String> initialList, final String... additionalStrings) {
|
||||
public static String[] fromFormatted(final List<String> initialList, final String... additionalStrings) {
|
||||
final var resultList = new ArrayList<>(initialList);
|
||||
resultList.addAll(Arrays.stream(additionalStrings)
|
||||
.filter(Objects::nonNull)
|
||||
|
Loading…
Reference in New Issue
Block a user