Skip to content
Snippets Groups Projects
Commit 46ef9135 authored by Felix Reichenbach's avatar Felix Reichenbach
Browse files

OZG-7515 fix naming

parent 8d37c213
Branches
Tags
1 merge request!11Ozg 7515 migrate patch item command
...@@ -105,7 +105,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase { ...@@ -105,7 +105,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private Document buildExpectedPatchAttachedItemCommand(Document patchAttachedItemCommand) { private Document buildExpectedPatchAttachedItemCommand(Document patchAttachedItemCommand) {
var body = new HashMap<>((Map<String, Object>) patchAttachedItemCommand.get(CommandDocumentTestFactory.BODY_OBJECT_FIELD)); var body = new HashMap<>(
(Map<String, Object>) patchAttachedItemCommand.get(CommandDocumentTestFactory.BODY_OBJECT_FIELD));
body.put(ITEM_NAME_FIELD, BESCHEID_ITEM_NAME); body.put(ITEM_NAME_FIELD, BESCHEID_ITEM_NAME);
var command = CommandDocumentTestFactory.createWithOrderAndBody(PATCH_ATTACHED_ITEM_ORDER, body); var command = CommandDocumentTestFactory.createWithOrderAndBody(PATCH_ATTACHED_ITEM_ORDER, body);
command.put(ID_FIELD, patchAttachedItemCommand.getObjectId(ID_FIELD)); command.put(ID_FIELD, patchAttachedItemCommand.getObjectId(ID_FIELD));
...@@ -129,9 +130,10 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase { ...@@ -129,9 +130,10 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
void shouldQueryPatchAttachedItemCommandsWithParentId() { void shouldQueryPatchAttachedItemCommandsWithParentId() {
var query = migration.createQuery(List.of(sendBescheidCommand.getObjectId(ID_FIELD).toString())); var query = migration.createQuery(List.of(sendBescheidCommand.getObjectId(ID_FIELD).toString()));
var comands = mongoOperations.find(query, Document.class, MigrationDbTestUtils.COMMAND_COLLECTION); var commands = mongoOperations.find(query, Document.class, MigrationDbTestUtils.COMMAND_COLLECTION);
assertThat(comands).usingRecursiveFieldByFieldElementComparator().containsExactly(patchAttachedItemCommand); assertThat(commands).usingRecursiveFieldByFieldElementComparator()
.containsExactly(patchAttachedItemCommand);
} }
} }
...@@ -143,7 +145,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase { ...@@ -143,7 +145,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
var command = migrationDbTestUtils.getCommand(patchAttachedItemCommand.getObjectId(ID_FIELD)); var command = migrationDbTestUtils.getCommand(patchAttachedItemCommand.getObjectId(ID_FIELD));
assertThat(command).usingRecursiveComparison().isEqualTo(buildExpectedPatchAttachedItemCommand(patchAttachedItemCommand)); assertThat(command).usingRecursiveComparison()
.isEqualTo(buildExpectedPatchAttachedItemCommand(patchAttachedItemCommand));
} }
} }
...@@ -151,7 +154,7 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase { ...@@ -151,7 +154,7 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
@Nested @Nested
class TestFullMigration { class TestFullMigration {
@Test @Test
void shouldContainSendBescheidCommand() { void shouldKeepSendBescheidCommand() {
migration.doMigration(mongoOperations); migration.doMigration(mongoOperations);
var command = migrationDbTestUtils.getCommand(sendBescheidCommand.getObjectId(ID_FIELD)); var command = migrationDbTestUtils.getCommand(sendBescheidCommand.getObjectId(ID_FIELD));
...@@ -165,7 +168,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase { ...@@ -165,7 +168,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
var command = migrationDbTestUtils.getCommand(patchAttachedItemCommand.getObjectId(ID_FIELD)); var command = migrationDbTestUtils.getCommand(patchAttachedItemCommand.getObjectId(ID_FIELD));
assertThat(command).usingRecursiveComparison().isEqualTo(buildExpectedPatchAttachedItemCommand(patchAttachedItemCommand)); assertThat(command).usingRecursiveComparison()
.isEqualTo(buildExpectedPatchAttachedItemCommand(patchAttachedItemCommand));
} }
@Test @Test
...@@ -192,7 +196,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase { ...@@ -192,7 +196,8 @@ class M014_AddItemNameBescheidToPatchAttachedItemCommandITCase {
var commands = mongoOperations.findAll(Document.class, MigrationDbTestUtils.COMMAND_COLLECTION); var commands = mongoOperations.findAll(Document.class, MigrationDbTestUtils.COMMAND_COLLECTION);
assertThat(commands).usingRecursiveFieldByFieldElementComparator().containsExactlyInAnyOrderElementsOf(expectedCommands); assertThat(commands).usingRecursiveFieldByFieldElementComparator()
.containsExactlyInAnyOrderElementsOf(expectedCommands);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment