Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
archive-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
archive-manager
Commits
090316fb
Commit
090316fb
authored
3 months ago
by
Krzysztof Witukiewicz
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7262 OZG-7584 Simplify tests
parent
ef9612eb
No related branches found
No related tags found
1 merge request
!6
Ozg 7262 attarchments not null
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
archive-manager-server/src/test/java/de/ozgcloud/archive/kommentar/KommentarMapperTest.java
+2
-8
2 additions, 8 deletions
...va/de/ozgcloud/archive/kommentar/KommentarMapperTest.java
with
2 additions
and
8 deletions
archive-manager-server/src/test/java/de/ozgcloud/archive/kommentar/KommentarMapperTest.java
+
2
−
8
View file @
090316fb
...
...
@@ -27,7 +27,6 @@ import static org.assertj.core.api.Assertions.*;
import
static
org
.
mockito
.
ArgumentMatchers
.*;
import
static
org
.
mockito
.
Mockito
.*;
import
java.util.Collection
;
import
java.util.Map
;
import
org.junit.jupiter.api.BeforeEach
;
...
...
@@ -165,21 +164,16 @@ class KommentarMapperTest {
void
shouldCallAttachmentMapper
()
{
callMapper
();
verify
(
attachmentMapper
).
mapAttachments
(
argThat
(
this
::
isCollectionOfAttachmentIds
)
);
verify
(
attachmentMapper
).
mapAttachments
(
GrpcKommentarTestFactory
.
ATTACHMENTS
);
}
@Test
void
shouldMapAllFields
()
{
var
kommentar
=
mapper
.
mapItemMapToKommentar
(
GrpcKommentarTestFactory
.
createItemAsMap
()
);
var
kommentar
=
callMapper
(
);
assertThat
(
kommentar
).
usingRecursiveComparison
().
isEqualTo
(
KommentarTestFactory
.
create
());
}
@SuppressWarnings
(
"unchecked"
)
private
boolean
isCollectionOfAttachmentIds
(
Object
obj
)
{
return
obj
instanceof
Collection
&&
((
Collection
<
String
>)
obj
).
containsAll
(
GrpcKommentarTestFactory
.
ATTACHMENTS
);
}
private
Kommentar
callMapper
()
{
return
mapper
.
mapItemMapToKommentar
(
GrpcKommentarTestFactory
.
createItemAsMap
());
}
...
...
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