-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISSUE-1469 Implement JMAP download all attachments (#1486)
Co-authored-by: hung phan <[email protected]> Co-authored-by: Benoit TELLIER <[email protected]>
- Loading branch information
1 parent
ca6cd37
commit 8fd1a89
Showing
7 changed files
with
763 additions
and
2 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
74 changes: 74 additions & 0 deletions
74
...gration-tests/src/test/java/com/linagora/tmail/james/DistributedDownloadAllRouteTest.java
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/******************************************************************** | ||
* As a subpart of Twake Mail, this file is edited by Linagora. * | ||
* * | ||
* https://twake-mail.com/ * | ||
* https://linagora.com * | ||
* * | ||
* This file is subject to The Affero Gnu Public License * | ||
* version 3. * | ||
* * | ||
* https://www.gnu.org/licenses/agpl-3.0.en.html * | ||
* * | ||
* This program is distributed in the hope that it will be * | ||
* useful, but WITHOUT ANY WARRANTY; without even the implied * | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * | ||
* PURPOSE. See the GNU Affero General Public License for * | ||
* more details. * | ||
********************************************************************/ | ||
|
||
package com.linagora.tmail.james; | ||
|
||
import org.apache.james.JamesServerBuilder; | ||
import org.apache.james.JamesServerExtension; | ||
import org.apache.james.SearchConfiguration; | ||
import org.apache.james.backends.redis.RedisExtension; | ||
import org.apache.james.jmap.rfc8621.contract.probe.DelegationProbeModule; | ||
import org.apache.james.mailbox.cassandra.ids.CassandraMessageId; | ||
import org.apache.james.mailbox.model.MessageId; | ||
import org.apache.james.modules.AwsS3BlobStoreExtension; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import com.datastax.oss.driver.api.core.uuid.Uuids; | ||
import com.linagora.tmail.blob.guice.BlobStoreConfiguration; | ||
import com.linagora.tmail.james.app.CassandraExtension; | ||
import com.linagora.tmail.james.app.DistributedJamesConfiguration; | ||
import com.linagora.tmail.james.app.DistributedServer; | ||
import com.linagora.tmail.james.app.EventBusKeysChoice; | ||
import com.linagora.tmail.james.app.RabbitMQExtension; | ||
import com.linagora.tmail.james.common.DownloadAllContract; | ||
import com.linagora.tmail.james.jmap.firebase.FirebaseModuleChooserConfiguration; | ||
import com.linagora.tmail.module.LinagoraTestJMAPServerModule; | ||
|
||
public class DistributedDownloadAllRouteTest implements DownloadAllContract { | ||
public static final CassandraMessageId.Factory MESSAGE_ID_FACTORY = new CassandraMessageId.Factory(); | ||
|
||
@RegisterExtension | ||
static JamesServerExtension testExtension = new JamesServerBuilder<DistributedJamesConfiguration>(tmpDir -> | ||
DistributedJamesConfiguration.builder() | ||
.workingDirectory(tmpDir) | ||
.configurationFromClasspath() | ||
.blobStore(BlobStoreConfiguration.builder() | ||
.s3() | ||
.noSecondaryS3BlobStore() | ||
.disableCache() | ||
.deduplication() | ||
.noCryptoConfig() | ||
.disableSingleSave()) | ||
.eventBusKeysChoice(EventBusKeysChoice.REDIS) | ||
.firebaseModuleChooserConfiguration(FirebaseModuleChooserConfiguration.DISABLED) | ||
.searchConfiguration(SearchConfiguration.scanning()) | ||
.build()) | ||
.extension(new CassandraExtension()) | ||
.extension(new RabbitMQExtension()) | ||
.extension(new RedisExtension()) | ||
.extension(new AwsS3BlobStoreExtension()) | ||
.server(configuration -> DistributedServer.createServer(configuration) | ||
.overrideWith(new LinagoraTestJMAPServerModule()) | ||
.overrideWith(new DelegationProbeModule())) | ||
.build(); | ||
|
||
@Override | ||
public MessageId randomMessageId() { | ||
return MESSAGE_ID_FACTORY.of(Uuids.timeBased()); | ||
} | ||
} |
Oops, something went wrong.