Skip to content
Snippets Groups Projects
Commit 9cdc09fe authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5899 fix bescheid mapping

parent 256e8141
Branches
Tags
No related merge requests found
......@@ -66,9 +66,9 @@ public interface BescheidMapper {
default Bescheid mapFromAttachedItem(AttachedItem item) {
var itemMap = item.getItem();
var builder = Bescheid.builder()
.id(BescheidId.from(MapUtils.getString(itemMap, AttachedItem.PROPERTY_ID)))
.version(MapUtils.getLongValue(itemMap, AttachedItem.PROPERTY_VERSION))
.vorgangId(VorgangId.from(MapUtils.getString(itemMap, Bescheid.FIELD_VORGANG_ID)))
.id(BescheidId.from(item.getId()))
.version(item.getVersion())
.vorgangId(VorgangId.from(item.getVorgangId()))
.createdBy(UserId.from(MapUtils.getString(itemMap, Bescheid.FIELD_CREATED_BY)))
.bewilligt(MapUtils.getBoolean(itemMap, Bescheid.FIELD_BEWILLIGT))
.nachrichtText(Optional.ofNullable(MapUtils.getString(itemMap, Bescheid.FIELD_NACHRICHT_TEXT)))
......
......@@ -15,6 +15,7 @@ import org.mapstruct.factory.Mappers;
import org.mockito.InjectMocks;
import org.mockito.Spy;
import de.ozgcloud.bescheid.vorgang.VorgangTestFactory;
import de.ozgcloud.common.attached_item.AttachedItemTestFactory;
class BescheidMapperTest {
......@@ -66,7 +67,9 @@ class BescheidMapperTest {
@Test
void shouldMapItem() {
var bescheid = mapper.mapFromAttachedItem(AttachedItemTestFactory.createBescheidWithoutDocument());
var bescheidWithoutDocument = AttachedItemTestFactory.createBescheidWithoutDocumentBuilder().vorgangId(VorgangTestFactory.ID_STR).build();
var bescheid = mapper.mapFromAttachedItem(bescheidWithoutDocument);
assertThat(bescheid).usingRecursiveComparison().isEqualTo(BescheidTestFactory.create());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment