Skip to content
Snippets Groups Projects
Commit 7ad38ec7 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5058 Refactored a test in M001_CreateEmptyPostfachIfMissingITCase

parent d171d91d
No related branches found
No related tags found
No related merge requests found
package de.ozgcloud.admin.migration;
import de.ozgcloud.common.test.DataITCase;
import static de.ozgcloud.admin.migration.M001_CreateEmptyPostfachIfMissing.*;
import static org.assertj.core.api.Assertions.*;
import java.util.List;
import org.bson.Document;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
......@@ -9,11 +13,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import java.util.List;
import static de.ozgcloud.admin.migration.M001_CreateEmptyPostfachIfMissing.SETTINGS_COLLECTION;
import static de.ozgcloud.admin.migration.M001_CreateEmptyPostfachIfMissing.TYPE_NAME_KEY;
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat;
import de.ozgcloud.common.test.DataITCase;
@DataITCase
class M001_CreateEmptyPostfachIfMissingITCase {
......@@ -37,12 +37,9 @@ class M001_CreateEmptyPostfachIfMissingITCase {
changeUnit.doMigration(template);
List<Document> settings = findAllSettings();
assertThat(settings).hasSize(1);
Document document = settings.getFirst();
System.out.println(document);
assertThat(document)
.usingRecursiveComparison().ignoringFields("_id")
.isEqualTo(MigrationTestFactory.createEmptyPostfach());
assertThat(settings).usingRecursiveFieldByFieldElementComparatorIgnoringFields("_id")
.containsExactly(MigrationTestFactory.createEmptyPostfach());
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment