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
ef9612eb
Commit
ef9612eb
authored
3 months ago
by
Krzysztof Witukiewicz
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7262 OZG-7584 Do not test individual fields
parent
07454fa4
Branches
Branches containing commit
Tags
Tags containing commit
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
+5
-66
5 additions, 66 deletions
...va/de/ozgcloud/archive/kommentar/KommentarMapperTest.java
with
5 additions
and
66 deletions
archive-manager-server/src/test/java/de/ozgcloud/archive/kommentar/KommentarMapperTest.java
+
5
−
66
View file @
ef9612eb
...
@@ -150,62 +150,8 @@ class KommentarMapperTest {
...
@@ -150,62 +150,8 @@ class KommentarMapperTest {
@BeforeEach
@BeforeEach
void
init
()
{
void
init
()
{
doReturn
(
KommentarTestFactory
.
ID
).
when
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
ID
);
when
(
timeMapper
.
parseString
(
any
())).
thenReturn
(
KommentarTestFactory
.
CREATED_AT
);
doReturn
(
KommentarTestFactory
.
TEXT
).
when
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
TEXT
);
when
(
attachmentMapper
.
mapAttachments
(
anyList
())).
thenReturn
(
KommentarTestFactory
.
ATTACHMENTS
);
doReturn
(
KommentarTestFactory
.
CREATED_BY
).
when
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
CREATED_BY
);
doReturn
(
KommentarTestFactory
.
CREATED_AT_STR
).
when
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
CREATED_AT_STR
);
when
(
timeMapper
.
parseString
(
KommentarTestFactory
.
CREATED_AT_STR
)).
thenReturn
(
KommentarTestFactory
.
CREATED_AT
);
when
(
attachmentMapper
.
mapAttachments
(
argThat
(
this
::
isCollectionOfAttachmentIds
))).
thenReturn
(
KommentarTestFactory
.
ATTACHMENTS
);
}
@Test
void
shouldMapIdToString
()
{
callMapper
();
verify
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
ID
);
}
@Test
void
shouldMapId
()
{
var
kommentar
=
callMapper
();
assertThat
(
kommentar
.
getId
()).
isEqualTo
(
KommentarTestFactory
.
ID
);
}
@Test
void
shouldMapTextToString
()
{
callMapper
();
verify
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
TEXT
);
}
@Test
void
shouldMapText
()
{
var
kommentar
=
callMapper
();
assertThat
(
kommentar
.
getText
()).
isEqualTo
(
KommentarTestFactory
.
TEXT
);
}
@Test
void
shouldMapCreatedByToString
()
{
callMapper
();
verify
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
CREATED_BY
);
}
@Test
void
shouldMapCreatedBy
()
{
var
kommentar
=
callMapper
();
assertThat
(
kommentar
.
getCreatedBy
()).
isEqualTo
(
KommentarTestFactory
.
CREATED_BY
);
}
@Test
void
shouldMapCreatedAtToString
()
{
callMapper
();
verify
(
mapper
).
mapObjectToString
(
KommentarTestFactory
.
CREATED_AT_STR
);
}
}
@Test
@Test
...
@@ -215,13 +161,6 @@ class KommentarMapperTest {
...
@@ -215,13 +161,6 @@ class KommentarMapperTest {
verify
(
timeMapper
).
parseString
(
KommentarTestFactory
.
CREATED_AT_STR
);
verify
(
timeMapper
).
parseString
(
KommentarTestFactory
.
CREATED_AT_STR
);
}
}
@Test
void
shouldMapCreatedAt
()
{
var
kommentar
=
callMapper
();
assertThat
(
kommentar
.
getCreatedAt
()).
isEqualTo
(
KommentarTestFactory
.
CREATED_AT
);
}
@Test
@Test
void
shouldCallAttachmentMapper
()
{
void
shouldCallAttachmentMapper
()
{
callMapper
();
callMapper
();
...
@@ -230,10 +169,10 @@ class KommentarMapperTest {
...
@@ -230,10 +169,10 @@ class KommentarMapperTest {
}
}
@Test
@Test
void
shouldMapA
ttachment
s
()
{
void
shouldMapA
llField
s
()
{
var
kommentar
=
callMapper
(
);
var
kommentar
=
mapper
.
mapItemMapToKommentar
(
GrpcKommentarTestFactory
.
createItemAsMap
()
);
assertThat
(
kommentar
.
getAttachments
()).
containsExactlyElementsOf
(
KommentarTestFactory
.
ATTACHMENTS
);
assertThat
(
kommentar
).
usingRecursiveComparison
().
isEqualTo
(
KommentarTestFactory
.
create
()
);
}
}
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
...
...
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