Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
administration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
administration
Commits
b57753e7
Commit
b57753e7
authored
7 months ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-6867 Rename method getAttributes()
parent
e0e6524a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/ozgcloud/admin/keycloak/GroupMapper.java
+2
-2
2 additions, 2 deletions
src/main/java/de/ozgcloud/admin/keycloak/GroupMapper.java
src/test/java/de/ozgcloud/admin/keycloak/GroupMapperTest.java
+6
-6
6 additions, 6 deletions
...test/java/de/ozgcloud/admin/keycloak/GroupMapperTest.java
with
8 additions
and
8 deletions
src/main/java/de/ozgcloud/admin/keycloak/GroupMapper.java
+
2
−
2
View file @
b57753e7
...
...
@@ -49,10 +49,10 @@ abstract class GroupMapper {
return
values
.
getFirst
();
}
@Mapping
(
target
=
"attributes"
,
expression
=
"java(
get
Attributes(groupToAdd))"
)
@Mapping
(
target
=
"attributes"
,
expression
=
"java(
buildGroup
Attributes(groupToAdd))"
)
public
abstract
GroupRepresentation
toGroupRepresentation
(
AddGroupData
groupToAdd
);
Map
<
String
,
List
<
String
>>
get
Attributes
(
AddGroupData
groupToAdd
)
{
Map
<
String
,
List
<
String
>>
buildGroup
Attributes
(
AddGroupData
groupToAdd
)
{
var
organisationsEinheitId
=
groupToAdd
.
getOrganisationsEinheitId
();
return
StringUtils
.
isNotBlank
(
organisationsEinheitId
)
?
Map
.
of
(
keycloakApiProperties
.
getOrganisationsEinheitIdKey
(),
List
.
of
(
organisationsEinheitId
))
:
...
...
This diff is collapsed.
Click to expand it.
src/test/java/de/ozgcloud/admin/keycloak/GroupMapperTest.java
+
6
−
6
View file @
b57753e7
...
...
@@ -253,7 +253,7 @@ class GroupMapperTest {
@BeforeEach
void
init
()
{
doReturn
(
ATTRIBUTES
).
when
(
mapper
).
get
Attributes
(
addGroupData
);
doReturn
(
ATTRIBUTES
).
when
(
mapper
).
buildGroup
Attributes
(
addGroupData
);
}
@Test
...
...
@@ -271,10 +271,10 @@ class GroupMapperTest {
}
@Test
void
should
Get
Attributes
()
{
void
should
BuildGroup
Attributes
()
{
callMapper
();
verify
(
mapper
).
get
Attributes
(
addGroupData
);
verify
(
mapper
).
buildGroup
Attributes
(
addGroupData
);
}
@Test
...
...
@@ -290,14 +290,14 @@ class GroupMapperTest {
}
@Nested
class
Test
Get
Attributes
{
class
Test
BuildGroup
Attributes
{
@ParameterizedTest
@NullAndEmptySource
void
shouldReturnEmptyMap
(
String
organisationsEinheitId
)
{
var
addGroupData
=
AddGroupDataTestFactory
.
createBuilder
().
organisationsEinheitId
(
organisationsEinheitId
).
build
();
var
attributes
=
mapper
.
get
Attributes
(
addGroupData
);
var
attributes
=
mapper
.
buildGroup
Attributes
(
addGroupData
);
assertThat
(
attributes
).
isEmpty
();
}
...
...
@@ -306,7 +306,7 @@ class GroupMapperTest {
void
shouldAddOrganisationsEinheitIdToAttributes
()
{
givenOrganisationsEinheitIdProperty
();
var
attributes
=
mapper
.
get
Attributes
(
AddGroupDataTestFactory
.
create
());
var
attributes
=
mapper
.
buildGroup
Attributes
(
AddGroupDataTestFactory
.
create
());
assertThat
(
attributes
).
hasSize
(
1
).
containsEntry
(
ORGANIZATIONS_EINHEIT_ID_ATTRIBUTE
,
List
.
of
(
GroupTestFactory
.
ORGANISATIONS_EINHEIT_ID
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment