Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vorgang-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
vorgang-manager
Commits
0657c181
Commit
0657c181
authored
3 months ago
by
Felix Reichenbach
Browse files
Options
Downloads
Patches
Plain Diff
OZG-7515 extract Strings to constants
parent
24b92e89
No related branches found
No related tags found
1 merge request
!11
Ozg 7515 migrate patch item command
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/common/migration/M014_AddItemNameBescheidToPatchAttachedItemCommandITCase.java
+12
-6
12 additions, 6 deletions
..._AddItemNameBescheidToPatchAttachedItemCommandITCase.java
with
12 additions
and
6 deletions
vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/common/migration/M014_AddItemNameBescheidToPatchAttachedItemCommandITCase.java
+
12
−
6
View file @
0657c181
...
...
@@ -43,6 +43,12 @@ import de.ozgcloud.vorgang.command.PersistedCommand;
@DataITCase
class
M014_AddItemNameBescheidToPatchAttachedItemCommandITCase
{
private
static
final
String
BESCHEID_ITEM_NAME
=
"Bescheid"
;
private
static
final
String
ITEM_NAME_FIELD
=
"itemName"
;
private
static
final
String
PATCH_ATTACHED_ITEM_ORDER
=
"PATCH_ATTACHED_ITEM"
;
private
static
final
String
PARENT_ID_FIELD
=
"parentId"
;
private
static
final
String
SEND_BESCHEID_ORDER
=
"SEND_BESCHEID"
;
@InjectMocks
private
M014_AddItemNameBescheidToPatchAttachedItemCommand
migration
;
@Autowired
...
...
@@ -70,22 +76,22 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
}
private
PersistedCommand
saveSendBescheidCommand
()
{
var
command
=
CommandTestFactory
.
createBuilder
().
id
(
null
).
order
(
"
SEND_BESCHEID
"
).
build
();
var
command
=
CommandTestFactory
.
createBuilder
().
id
(
null
).
order
(
SEND_BESCHEID
_ORDER
).
build
();
return
mongoOperations
.
save
(
command
);
}
private
PersistedCommand
savePatchAttachedItemSubCommand
(
String
id
)
{
Map
<
String
,
Object
>
itemBody
=
Map
.
of
(
"parentId"
,
id
);
Map
<
String
,
Object
>
itemBody
=
Map
.
of
(
PARENT_ID_FIELD
,
id
);
var
command
=
CommandTestFactory
.
createBuilder
()
.
id
(
null
)
.
order
(
"
PATCH_ATTACHED_ITEM
"
)
.
order
(
PATCH_ATTACHED_ITEM
_ORDER
)
.
bodyObject
(
itemBody
)
.
build
();
return
mongoOperations
.
save
(
command
);
}
private
PersistedCommand
saveOtherSubCommand
(
String
id
)
{
Map
<
String
,
Object
>
itemBody
=
Map
.
of
(
"parentId"
,
id
);
Map
<
String
,
Object
>
itemBody
=
Map
.
of
(
PARENT_ID_FIELD
,
id
);
var
command
=
CommandTestFactory
.
createBuilder
()
.
id
(
null
)
.
bodyObject
(
itemBody
)
...
...
@@ -96,14 +102,14 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
private
PersistedCommand
saveOtherPatchAttachedItemSubCommand
()
{
var
command
=
CommandTestFactory
.
createBuilder
()
.
id
(
null
)
.
order
(
"
PATCH_ATTACHED_ITEM
"
)
.
order
(
PATCH_ATTACHED_ITEM
_ORDER
)
.
build
();
return
mongoOperations
.
save
(
command
);
}
private
PersistedCommand
buildExpectedPatchAttachedItemCommand
(
Command
patchAttachedItemCommand
)
{
var
body
=
new
HashMap
<>(
patchAttachedItemCommand
.
getBodyObject
());
body
.
put
(
"itemName"
,
"Bescheid"
);
body
.
put
(
ITEM_NAME_FIELD
,
BESCHEID_ITEM_NAME
);
return
CommandTestFactory
.
createBuilder
()
.
id
(
patchAttachedItemCommand
.
getId
())
.
order
(
patchAttachedItemCommand
.
getOrder
())
...
...
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