Skip to content
Snippets Groups Projects
Commit cc4bd47c authored by Lukas Malte Monnerjahn's avatar Lukas Malte Monnerjahn
Browse files

OZG-6897 vararg

parent ec928ce7
Branches
Tags
No related merge requests found
......@@ -181,8 +181,6 @@ class UserResourceMapperTest {
@DisplayName("Map organisations einheit ids")
@Nested
class TestMapOrganisationsEinheitIds {
private UserResource userResource;
static final String ORGANISATIONS_EINHEIT_ID_3 = "6287";
private final GroupRepresentation group1 = GroupRepresentationTestFactory.createByPathAndOrganisationEinheitIds(
GROUP_1_PATH, ORGANISATIONS_EINHEIT_ID_1, ORGANISATIONS_EINHEIT_ID_3);
......@@ -196,7 +194,7 @@ class UserResourceMapperTest {
@Test
void shouldMapOrganisationsEinheitIdsFromSingleGroup() {
userResource = UserResourceTestFactory.createWithGroups(List.of(group1));
var userResource = UserResourceTestFactory.createWithGroups(group1);
when(realm.getGroupByPath(GROUP_1_PATH)).thenReturn(group1);
var result = mapper.mapOrganisationsEinheitIds(userResource);
......@@ -206,7 +204,7 @@ class UserResourceMapperTest {
@Test
void shouldMapOrganisationsEinheitIdsFromGroups() {
userResource = UserResourceTestFactory.createWithGroups(List.of(group1, group2));
var userResource = UserResourceTestFactory.createWithGroups(group1, group2);
when(realm.getGroupByPath(GROUP_1_PATH)).thenReturn(group1);
when(realm.getGroupByPath(GROUP_2_PATH)).thenReturn(group2);
......@@ -222,7 +220,7 @@ class UserResourceMapperTest {
@Test
void shouldMapOrganisationsEinheitIdsFromUser() {
var attributes = Map.of(ORGANISATIONS_EINHEIT_ID_KEY, List.of(ORGANISATIONS_EINHEIT_ID_1, ORGANISATIONS_EINHEIT_ID_2));
userResource = UserResourceTestFactory.createWithAttributes(attributes);
var userResource = UserResourceTestFactory.createWithAttributes(attributes);
var result = mapper.mapOrganisationsEinheitIds(userResource);
......@@ -231,7 +229,7 @@ class UserResourceMapperTest {
@Test
void shouldReturnEmptyIfNoOrganisationsEinheitIds() {
userResource = UserResourceTestFactory.create();
var userResource = UserResourceTestFactory.create();
var result = mapper.mapOrganisationsEinheitIds(userResource);
......
......@@ -39,7 +39,7 @@ public class UserResourceTestFactory {
return new UserResourceStub(attributes);
}
public static UserResource createWithGroups(List<GroupRepresentation> groups) {
return new UserResourceStub(groups);
public static UserResource createWithGroups(GroupRepresentation... groups) {
return new UserResourceStub(List.of(groups));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment