@Test void toDTOShouldConvertQueryWithHasAttachement() { Query query = Query.of( CriterionFactory.hasAttachment(true) ); assertThat(queryTranslator.toDTO(query)).isEqualTo(QueryDTO.and( new CriterionDTO(FieldName.HAS_ATTACHMENT.getValue(), Operator.EQUALS.getValue(), "true") )); }
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);  }