|
| 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