Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
user-manager
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
user-manager
Commits
ec928ce7
Commit
ec928ce7
authored
7 months ago
by
Lukas Malte Monnerjahn
Browse files
Options
Downloads
Patches
Plain Diff
OZG-6897 clean up test
parent
fc458932
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
user-manager-server/src/test/java/de/ozgcloud/user/UserResourceMapperTest.java
+6
-12
6 additions, 12 deletions
...rc/test/java/de/ozgcloud/user/UserResourceMapperTest.java
with
6 additions
and
12 deletions
user-manager-server/src/test/java/de/ozgcloud/user/UserResourceMapperTest.java
+
6
−
12
View file @
ec928ce7
...
...
@@ -29,6 +29,7 @@ import static org.mockito.Mockito.*;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.DisplayName
;
...
...
@@ -66,7 +67,7 @@ class UserResourceMapperTest {
@Mock
RealmResource
realm
;
private
UserResource
userResource
;
final
Set
<
String
>
organisationsEinheitIds
=
Set
.
of
(
ORGANISATIONS_EINHEIT_ID_1
)
;
@DisplayName
(
"To kop user"
)
@Nested
...
...
@@ -75,15 +76,8 @@ class UserResourceMapperTest {
@BeforeEach
void
init
()
{
when
(
properties
.
ldapIdKey
()).
thenReturn
(
"LDAP_ID"
);
when
(
properties
.
organisationsEinheitIdKey
()).
thenReturn
(
"organisationseinheitId"
);
when
(
properties
.
client
()).
thenReturn
(
"alfa"
);
when
(
realm
.
getGroupByPath
(
GROUP_1_PATH
))
.
thenReturn
(
GroupRepresentationTestFactory
.
createByPathAndOrganisationEinheitIds
(
GROUP_1_PATH
,
ORGANISATIONS_EINHEIT_ID_1
));
when
(
properties
.
ldapIdKey
()).
thenReturn
(
"LDAP_ID"
);
when
(
properties
.
organisationsEinheitIdKey
()).
thenReturn
(
"organisationseinheitId"
);
when
(
properties
.
client
()).
thenReturn
(
"alfa"
);
userResource
=
UserResourceTestFactory
.
create
();
doReturn
(
organisationsEinheitIds
).
when
(
mapper
).
mapOrganisationsEinheitIds
(
any
());
}
@Test
...
...
@@ -142,9 +136,9 @@ class UserResourceMapperTest {
@Test
void
shouldMapOrganisationsEinheitIds
()
{
toKopUser
();
var
result
=
toKopUser
();
verify
(
mapper
).
map
OrganisationsEinheitIds
(
userResource
);
assertThat
(
result
.
get
OrganisationsEinheitIds
(
)).
hasSameElementsAs
(
organisationsEinheitIds
);
}
@Test
...
...
@@ -176,7 +170,7 @@ class UserResourceMapperTest {
}
private
User
toKopUser
()
{
return
toKopUser
(
u
serResource
);
return
toKopUser
(
U
serResource
TestFactory
.
create
()
);
}
private
User
toKopUser
(
UserResource
userResource
)
{
...
...
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