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

Merge remote-tracking branch 'origin/main' into OZG-7517-add-Bescheid-item-name

parents acbae3cd 5a924e8d
Branches
Tags
1 merge request!2OZG-7517 add itemName to SetBescheidSentStatusCommand
......@@ -47,7 +47,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import de.ozgcloud.command.Command;
import de.ozgcloud.common.binaryfile.FileId;
import de.ozgcloud.common.datatype.StringBasedValue;
import de.ozgcloud.document.bescheid.Bescheid.SendBy;
import de.ozgcloud.document.bescheid.vorgang.VorgangId;
import de.ozgcloud.document.common.attached_item.AttachedItem;
import de.ozgcloud.document.common.attached_item.AttachedItemService;
......@@ -111,7 +110,6 @@ public abstract class BescheidMapper {
@Mapping(target = "defaultInstanceForType", ignore = true)
@Mapping(target = "bescheidOrBuilder", ignore = true)
@Mapping(target = "bescheid", ignore = true)
@Mapping(target = "mergeFrom", ignore = true)
@Mapping(target = "clearField", ignore = true)
@Mapping(target = "clearOneof", ignore = true)
......@@ -156,7 +154,7 @@ public abstract class BescheidMapper {
bescheidBuilder.nachrichtSubject(getNachrichtSubject(bescheidMap));
bescheidBuilder.nachrichtText(getNachrichtText(bescheidMap));
getSendBy(bescheidMap).ifPresent(bescheidBuilder::sendBy);
mapToAttachments(bescheidMap.get(Bescheid.FIELD_ATTACHMENTS)).ifPresent(bescheidBuilder::attachments);
mapToAttachments(bescheidMap.get(FIELD_ATTACHMENTS)).ifPresent(bescheidBuilder::attachments);
getSentInfo(bescheidMap).ifPresent(bescheidBuilder::sentInfo);
return bescheidBuilder;
}
......
......@@ -40,11 +40,11 @@ import org.mapstruct.factory.Mappers;
import org.mockito.InjectMocks;
import org.mockito.Spy;
import de.ozgcloud.document.bescheid.vorgang.VorgangTestFactory;
import de.ozgcloud.command.CommandTestFactory;
import de.ozgcloud.document.DocumentTestFactory;
import de.ozgcloud.document.bescheid.vorgang.VorgangTestFactory;
import de.ozgcloud.document.common.attached_item.AttachedItemService;
import de.ozgcloud.document.common.attached_item.AttachedItemTestFactory;
import de.ozgcloud.document.DocumentTestFactory;
class BescheidMapperTest {
......@@ -73,7 +73,7 @@ class BescheidMapperTest {
void shouldMapAllFields() {
var result = mapper.toBescheid(BescheidTestFactory.create());
assertThat(result).usingRecursiveComparison().isEqualTo(GrpcBescheidWithoutDocumentTestFactory.create());
assertThat(result).isEqualTo(GrpcBescheidWithoutDocumentTestFactory.create());
}
}
......@@ -84,7 +84,7 @@ class BescheidMapperTest {
void shouldMapAllFields() {
var result = mapper.fromBescheidManagerConfig(BescheidManagerConfigTestFactory.create());
assertThat(result).usingRecursiveComparison().isEqualTo(GrpcBescheidManagerConfigResponseTestFactory.create());
assertThat(result).isEqualTo(GrpcBescheidManagerConfigResponseTestFactory.create());
}
}
......@@ -135,6 +135,18 @@ class BescheidMapperTest {
}
}
@DisplayName("To get bescheid response")
@Nested
class TestToGetBescheidResponse {
@Test
void shouldMap() {
var response = mapper.toGetBescheidResponse(BescheidTestFactory.create());
assertThat(response).isEqualTo(GrpcGetBescheidResponseTestFactory.create());
}
}
@DisplayName("To get bescheid draft response")
@Nested
class TestToGetBescheidDraftResponse {
......@@ -143,7 +155,7 @@ class BescheidMapperTest {
void shouldMap() {
var response = mapper.toGetBescheidDraftResponse(BescheidTestFactory.create());
assertThat(response).usingRecursiveComparison().isEqualTo(GrpcGetBescheidDraftResponseTestFactory.create());
assertThat(response).isEqualTo(GrpcGetBescheidDraftResponseTestFactory.create());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment