Skip to content

Commit

Permalink
fix: fixed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
daho4b committed Sep 15, 2021
1 parent e1b60b1 commit 79812c5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import de.caritas.cob.messageservice.statisticsservice.generated.web.model.CreateMessageStatisticsEventMessage;
import de.caritas.cob.messageservice.statisticsservice.generated.web.model.EventType;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Optional;
import org.jeasy.random.EasyRandom;
import org.junit.Test;
Expand All @@ -39,12 +40,14 @@ public void convertStringToAliasMessageDTO_Should_returnOptionalEmpty_When_jsonS
@Test
public void serialize_Should_returnOptionalWithSerializedObject() {

OffsetDateTime offsetDateTime = CustomOffsetDateTime.nowInUtc();

CreateMessageStatisticsEventMessage createMessageStatisticsEventMessage =
new CreateMessageStatisticsEventMessage()
.eventType(EventType.CREATE_MESSAGE)
.rcGroupId(RC_GROUP_ID)
.consultantId(CONSULTANT_ID)
.timestamp(CustomOffsetDateTime.nowInUtc())
.timestamp(offsetDateTime)
.hasAttachment(false);

Optional<String> result =
Expand All @@ -62,7 +65,7 @@ public void serialize_Should_returnOptionalWithSerializedObject() {
+ CONSULTANT_ID
+ "\","
+ " \"timestamp\":\""
+ CustomOffsetDateTime.nowInUtc()
+ offsetDateTime.format(DateTimeFormatter.ISO_DATE_TIME)
+ "\","
+ " \"eventType\":\""
+ EventType.CREATE_MESSAGE
Expand Down

0 comments on commit 79812c5

Please sign in to comment.