@Test public void toQueryString() throws Exception { Mailbox mbox = MailboxManager.getInstance().getMailboxByAccountId(MockProvisioning.DEFAULT_ACCOUNT_ID); AttachmentQuery query = new AttachmentQuery("any"); Assert.assertEquals( "(attachment:any)", ((LuceneQueryOperation) query.compile(mbox, true)).toQueryString()); }
@Test public void notAny() throws Exception { AttachmentQuery query = new AttachmentQuery("any"); query.setModifier(Query.Modifier.MINUS); Assert.assertEquals("Q(attachment:none)", query.toString()); }