Skip to content
Snippets Groups Projects
Commit 542f43c5 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5666 add sentAt to RueckfrageAnswer

parent a60fd3a7
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@ message GrpcRueckfrageAnswer {
string rueckfrageId = 1;
string answerText = 2;
repeated string attachmentFileId = 3;
string sentAt = 4;
}
message GrpcSendRueckfrageAnswerResponse {
......
......@@ -72,7 +72,6 @@ interface AntragraumNachrichtMapper {
@Mapping(target = "postfachAddress", ignore = true)
@Mapping(target = "postfachId", ignore = true)
@Mapping(target = "replyOption", constant = "FORBIDDEN")
@Mapping(target = "sentAt", ignore = true)
@Mapping(target = "sentSuccessful", constant = "true")
@Mapping(target = "subject", constant = "Antwort") // TODO klären
@Mapping(target = "vorgangId", ignore = true)
......
......@@ -32,9 +32,9 @@ import org.mapstruct.factory.Mappers;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht.Direction;
import de.ozgcloud.nachrichten.postfach.PostfachNachricht.ReplyOption;
import de.ozgcloud.nachrichten.postfach.PostfachNachrichtTestFactory;
import de.ozgcloud.nachrichten.postfach.osi.MessageTestFactory;
import de.ozgcloud.nachrichten.postfach.osi.ReplyOption;
class AntragraumNachrichtMapperTest {
......@@ -123,17 +123,17 @@ class AntragraumNachrichtMapperTest {
}
@Test
void shouldMapDirection() {
void shouldSetDirection() {
var result = map();
assertThat(result.getDirection()).isEqualTo(Direction.IN);
}
@Test
void shouldMapReplyOption() {
void shouldSetReplyOption() {
var result = map();
assertThat(result.getReplyOption()).hasToString(ReplyOption.FORBIDDEN.name());
assertThat(result.getReplyOption()).isEqualTo(ReplyOption.FORBIDDEN);
}
@Test
......@@ -143,6 +143,13 @@ class AntragraumNachrichtMapperTest {
assertThat(result.getCreatedAt()).isCloseTo(ZonedDateTime.now(), within(2, ChronoUnit.SECONDS));
}
@Test
void shouldSetSentAt() {
var result = map();
assertThat(result.getSentAt()).isCloseTo(PostfachNachrichtTestFactory.SENT_AT, within(2, ChronoUnit.SECONDS));
}
private PostfachNachricht map() {
return mapper.fromRueckfrageAnswer(GrpcRueckfrageAnswerTestFactory.create());
}
......
......@@ -5,6 +5,8 @@ import java.util.UUID;
import com.thedeanda.lorem.LoremIpsum;
import de.ozgcloud.nachrichten.postfach.PostfachNachrichtTestFactory;
public class GrpcRueckfrageAnswerTestFactory {
static final String RUECKFRAGE_ID = UUID.randomUUID().toString();
static final String TEXT = LoremIpsum.getInstance().getParagraphs(2, 4);
......@@ -18,6 +20,7 @@ public class GrpcRueckfrageAnswerTestFactory {
return GrpcRueckfrageAnswer.newBuilder()
.setRueckfrageId(RUECKFRAGE_ID)
.setAnswerText(TEXT)
.addAllAttachmentFileId(ATTACHMENT_ID_LIST);
.addAllAttachmentFileId(ATTACHMENT_ID_LIST)
.setSentAt(PostfachNachrichtTestFactory.SENT_AT_STR);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment