-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JAMES-4092 Update webadmin to filter content from mail repository (#2600
- Loading branch information
1 parent
20b2a95
commit 7f5aad4
Showing
9 changed files
with
582 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,13 +34,16 @@ | |
import org.apache.james.blob.cassandra.CassandraBlobModule; | ||
import org.apache.james.blob.cassandra.CassandraBlobStoreFactory; | ||
import org.apache.james.blob.mail.MimeMessageStore; | ||
import org.apache.james.core.builder.MimeMessageBuilder; | ||
import org.apache.james.mailrepository.MailRepositoryContract; | ||
import org.apache.james.mailrepository.api.MailKey; | ||
import org.apache.james.mailrepository.api.MailRepository; | ||
import org.apache.james.mailrepository.api.MailRepositoryPath; | ||
import org.apache.james.mailrepository.api.MailRepositoryUrl; | ||
import org.apache.james.mailrepository.api.Protocol; | ||
import org.apache.james.metrics.tests.RecordingMetricFactory; | ||
import org.apache.james.server.core.MailImpl; | ||
import org.apache.mailet.Mail; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Disabled; | ||
import org.junit.jupiter.api.Nested; | ||
|
@@ -181,6 +184,32 @@ void removeShouldNotAffectMailsWithTheSameContent() throws Exception { | |
assertThatCode(() -> testee.retrieve(key2)) | ||
.doesNotThrowAnyException(); | ||
} | ||
|
||
@Test | ||
void listWithConditionsShouldReturnStoredMailsKeys() throws Exception { | ||
MailRepository testee = retrieveRepository(); | ||
|
||
Mail mail = MailImpl.builder() | ||
.name("mail1") | ||
.sender("[email protected]") | ||
.addRecipient("[email protected]") | ||
.mimeMessage(MimeMessageBuilder.mimeMessageBuilder().build()) | ||
.build(); | ||
|
||
Mail mail2 = MailImpl.builder() | ||
.name("mail2") | ||
.sender("[email protected]") | ||
.addRecipient("[email protected]") | ||
.mimeMessage(MimeMessageBuilder.mimeMessageBuilder().build()) | ||
.build(); | ||
|
||
MailKey key1 = testee.store(mail); | ||
testee.store(mail2); | ||
|
||
assertThat(testee.list(new MailRepository.SenderCondition("[email protected]"))) | ||
.toIterable() | ||
.containsOnly(key1); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.