@Test void toDTOShouldConvertQueryWithDeletionDateAfterOrEquals() throws Exception { String serializedDate = "2007-12-03T10:15:30+01:00[Europe/Paris]"; Query query = Query.of( CriterionFactory.deletionDate().afterOrEquals(ZonedDateTime.parse(serializedDate)) ); assertThat(queryTranslator.toDTO(query)).isEqualTo(QueryDTO.and( new CriterionDTO(FieldName.DELETION_DATE.getValue(), Operator.AFTER_OR_EQUALS.getValue(), serializedDate) )); }
public QueryDTO toDTO(Query query) throws QueryTranslatorException { List<QueryElement> queryElements = query.getCriteria().stream() .map(this::toDTO) .collect(Guavate.toImmutableList()); return new QueryDTO(Combinator.AND.getValue(), queryElements); }
QueryTranslator { public QueryDTO toDTO(Query query) throws QueryTranslatorException { List<QueryElement> queryElements = query.getCriteria().stream() .map(this::toDTO) .collect(Guavate.toImmutableList()); return new QueryDTO(Combinator.AND.getValue(), queryElements); } }
QueryTranslator { public QueryDTO toDTO(Query query) throws QueryTranslatorException { List<QueryElement> queryElements = query.getCriteria().stream() .map(this::toDTO) .collect(Guavate.toImmutableList()); return new QueryDTO(Combinator.AND.getValue(), queryElements); } @Inject @VisibleForTesting  QueryTranslator(MailboxId.Factory mailboxIdFactory); }
QueryTranslator { public QueryDTO toDTO(Query query) throws QueryTranslatorException { List<QueryElement> queryElements = query.getCriteria().stream() .map(this::toDTO) .collect(Guavate.toImmutableList()); return new QueryDTO(Combinator.AND.getValue(), queryElements); } @Inject @VisibleForTesting  QueryTranslator(MailboxId.Factory mailboxIdFactory); static FieldName getField(String fieldNameString); Query translate(QueryElement queryElement); QueryDTO toDTO(Query query); }
QueryTranslator { public QueryDTO toDTO(Query query) throws QueryTranslatorException { List<QueryElement> queryElements = query.getCriteria().stream() .map(this::toDTO) .collect(Guavate.toImmutableList()); return new QueryDTO(Combinator.AND.getValue(), queryElements); } @Inject @VisibleForTesting  QueryTranslator(MailboxId.Factory mailboxIdFactory); static FieldName getField(String fieldNameString); Query translate(QueryElement queryElement); QueryDTO toDTO(Query query);  }