Skip to content
Snippets Groups Projects
Commit a041f105 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

#5 send: Adjust request mapping

parent 184f4897
No related branches found
No related tags found
Loading
Pipeline #1311 passed
......@@ -19,16 +19,14 @@ import de.ozgcloud.nachrichten.postfach.osiv2.gen.model.V1ReplyBehavior;
@Mapper(unmappedTargetPolicy = ReportingPolicy.ERROR)
public interface RequestMapper {
String ORIGIN_SENDER = "OZG-Cloud";
@Mapping(target = "sequencenumber", source = "vorgangId")
@Mapping(target = "body", source = "mailBody")
@Mapping(target = "displayName", source = "createdBy")
@Mapping(target = "originSender", constant = ORIGIN_SENDER)
@Mapping(target = "originSender", ignore = true)
@Mapping(target = "replyAction", source = "replyOption")
@Mapping(target = "eidasLevel", constant = "LOW")
@Mapping(target = "isObligatory", expression = "java( false )")
@Mapping(target = "isHtml", expression = "java( true )")
@Mapping(target = "isHtml", expression = "java( false )")
@Mapping(target = "files", expression = "java( mapMessageExchangeFiles() )")
@Mapping(target = "references", expression = "java( mapReferences() )")
OutSendMessageRequestV2 mapOutSendMessageRequestV2(PostfachNachricht nachricht);
......
......@@ -2,7 +2,6 @@ package de.ozgcloud.nachrichten.postfach.osiv2.transfer;
import static de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachAddressTestFactory.*;
import static de.ozgcloud.nachrichten.postfach.osiv2.factory.PostfachNachrichtTestFactory.*;
import static de.ozgcloud.nachrichten.postfach.osiv2.transfer.RequestMapper.*;
import static org.assertj.core.api.Assertions.*;
import java.util.stream.Stream;
......@@ -79,7 +78,6 @@ class RequestMapperTest {
assertThat(result.getSequencenumber()).isEqualTo(VORGANG_ID);
}
@DisplayName("should map subject")
@Test
void shouldMapSubject() {
......@@ -104,12 +102,12 @@ class RequestMapperTest {
assertThat(result.getDisplayName()).isEqualTo(USER_ID);
}
@DisplayName("should map origin sender")
@DisplayName("should map origin sender to null")
@Test
void shouldMapOriginSender() {
void shouldMapOriginSenderToNull() {
var result = doMapping();
assertThat(result.getOriginSender()).isEqualTo(ORIGIN_SENDER);
assertThat(result.getOriginSender()).isNull();
}
@DisplayName("should map forbidden reply action")
......@@ -165,7 +163,7 @@ class RequestMapperTest {
void shouldSetIsHtml() {
var result = doMapping();
assertThat(result.getIsHtml()).isTrue();
assertThat(result.getIsHtml()).isFalse();
}
@DisplayName("should map files")
......@@ -181,7 +179,7 @@ class RequestMapperTest {
void shouldMapReferences() {
var result = doMapping();
assertThat(result.getFiles()).isEmpty();
assertThat(result.getReferences()).isEmpty();
}
private OutSendMessageRequestV2 doMapping() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment