@Test void getUpdatedJsonMessagePartShouldBehaveWellOnNonEmptyFlags() throws Exception { MessageToElasticSearchJson messageToElasticSearchJson = new MessageToElasticSearchJson( new DefaultTextExtractor(), ZoneId.of("Europe/Paris"), IndexAttachments.YES); assertThatJson(messageToElasticSearchJson.getUpdatedJsonMessagePart(new FlagsBuilder().add(Flags.Flag.DELETED, Flags.Flag.FLAGGED).add("user").build(), MOD_SEQ)) .isEqualTo("{\"modSeq\":42,\"isAnswered\":false,\"isDeleted\":true,\"isDraft\":false,\"isFlagged\":true,\"isRecent\":false,\"userFlags\":[\"user\"],\"isUnread\":true}"); }
public String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq) throws JsonProcessingException { Preconditions.checkNotNull(flags); return mapper.writeValueAsString(new MessageUpdateJson(flags, modSeq)); }
MessageToElasticSearchJson { public String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq) throws JsonProcessingException { Preconditions.checkNotNull(flags); return mapper.writeValueAsString(new MessageUpdateJson(flags, modSeq)); } }
MessageToElasticSearchJson { public String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq) throws JsonProcessingException { Preconditions.checkNotNull(flags); return mapper.writeValueAsString(new MessageUpdateJson(flags, modSeq)); } MessageToElasticSearchJson(TextExtractor textExtractor, ZoneId zoneId, IndexAttachments indexAttachments); @Inject  MessageToElasticSearchJson(TextExtractor textExtractor, IndexAttachments indexAttachments); }
MessageToElasticSearchJson { public String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq) throws JsonProcessingException { Preconditions.checkNotNull(flags); return mapper.writeValueAsString(new MessageUpdateJson(flags, modSeq)); } MessageToElasticSearchJson(TextExtractor textExtractor, ZoneId zoneId, IndexAttachments indexAttachments); @Inject  MessageToElasticSearchJson(TextExtractor textExtractor, IndexAttachments indexAttachments); String convertToJson(MailboxMessage message, List<Username> usernames); String convertToJsonWithoutAttachment(MailboxMessage message, List<Username> usernames); String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq); }
MessageToElasticSearchJson { public String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq) throws JsonProcessingException { Preconditions.checkNotNull(flags); return mapper.writeValueAsString(new MessageUpdateJson(flags, modSeq)); } MessageToElasticSearchJson(TextExtractor textExtractor, ZoneId zoneId, IndexAttachments indexAttachments); @Inject  MessageToElasticSearchJson(TextExtractor textExtractor, IndexAttachments indexAttachments); String convertToJson(MailboxMessage message, List<Username> usernames); String convertToJsonWithoutAttachment(MailboxMessage message, List<Username> usernames); String getUpdatedJsonMessagePart(Flags flags, ModSeq modSeq);  }