Skip to content

Commit 12a8833

Browse files
authored
Merge pull request #749 from apache/master
[pull] master from apache:master
2 parents b3ab5d3 + 2d46f2f commit 12a8833

11 files changed

Lines changed: 1031 additions & 6 deletions

File tree

server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/rfc8621/RFC8621MethodsModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.apache.james.jmap.mail.DefaultNamespaceFactory;
5353
import org.apache.james.jmap.mail.NamespaceFactory;
5454
import org.apache.james.jmap.mail.SortOrderProvider;
55+
import org.apache.james.jmap.method.BlobCopyMethod;
5556
import org.apache.james.jmap.method.CoreEchoMethod;
5657
import org.apache.james.jmap.method.DelegateGetMethod;
5758
import org.apache.james.jmap.method.DelegateSetMethod;
@@ -141,6 +142,7 @@ protected void configure() {
141142

142143
Multibinder<Method> methods = Multibinder.newSetBinder(binder(), Method.class);
143144
methods.addBinding().to(CoreEchoMethod.class);
145+
methods.addBinding().to(BlobCopyMethod.class);
144146
methods.addBinding().to(EmailChangesMethod.class);
145147
methods.addBinding().to(EmailImportMethod.class);
146148
methods.addBinding().to(EmailGetMethod.class);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/****************************************************************
2+
* Licensed to the Apache Software Foundation (ASF) under one *
3+
* or more contributor license agreements. See the NOTICE file *
4+
* distributed with this work for additional information *
5+
* regarding copyright ownership. The ASF licenses this file *
6+
* to you under the Apache License, Version 2.0 (the *
7+
* "License"); you may not use this file except in compliance *
8+
* with the License. You may obtain a copy of the License at *
9+
* *
10+
* http://www.apache.org/licenses/LICENSE-2.0 *
11+
* *
12+
* Unless required by applicable law or agreed to in writing, *
13+
* software distributed under the License is distributed on an *
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
15+
* KIND, either express or implied. See the License for the *
16+
* specific language governing permissions and limitations *
17+
* under the License. *
18+
****************************************************************/
19+
20+
package org.apache.james.jmap.rfc8621.distributed;
21+
22+
import org.apache.james.CassandraExtension;
23+
import org.apache.james.CassandraRabbitMQJamesConfiguration;
24+
import org.apache.james.CassandraRabbitMQJamesServerMain;
25+
import org.apache.james.DockerOpenSearchExtension;
26+
import org.apache.james.JamesServerBuilder;
27+
import org.apache.james.JamesServerExtension;
28+
import org.apache.james.SearchConfiguration;
29+
import org.apache.james.jmap.rfc8621.contract.BlobCopyContract;
30+
import org.apache.james.jmap.rfc8621.contract.BlobCopyContract$;
31+
import org.apache.james.jmap.rfc8621.contract.probe.DelegationProbeModule;
32+
import org.apache.james.modules.AwsS3BlobStoreExtension;
33+
import org.apache.james.modules.RabbitMQExtension;
34+
import org.apache.james.modules.TestJMAPServerModule;
35+
import org.apache.james.modules.blobstore.BlobStoreConfiguration;
36+
import org.junit.jupiter.api.extension.RegisterExtension;
37+
38+
import com.google.common.collect.ImmutableMap;
39+
40+
public class DistributedBlobCopyTest implements BlobCopyContract {
41+
@RegisterExtension
42+
static JamesServerExtension testExtension = new JamesServerBuilder<CassandraRabbitMQJamesConfiguration>(tmpDir ->
43+
CassandraRabbitMQJamesConfiguration.builder()
44+
.workingDirectory(tmpDir)
45+
.configurationFromClasspath()
46+
.enableJMAP()
47+
.blobStore(BlobStoreConfiguration.builder()
48+
.s3()
49+
.disableCache()
50+
.deduplication()
51+
.noCryptoConfig())
52+
.searchConfiguration(SearchConfiguration.openSearch())
53+
.build())
54+
.extension(new DockerOpenSearchExtension())
55+
.extension(new CassandraExtension())
56+
.extension(new RabbitMQExtension())
57+
.extension(new AwsS3BlobStoreExtension())
58+
.server(configuration -> CassandraRabbitMQJamesServerMain.createServer(configuration)
59+
.overrideWith(new TestJMAPServerModule(ImmutableMap.of("upload.quota.limit", BlobCopyContract$.MODULE$.TWENTY_KILO_BYTES_UPLOAD_QUOTA_LIMIT())),
60+
new DelegationProbeModule()))
61+
.build();
62+
}

0 commit comments

Comments
 (0)