Arsnael commented on a change in pull request #570:
URL: https://github.com/apache/james-project/pull/570#discussion_r681642011



##########
File path: 
server/protocols/protocols-pop3-distributed/src/main/java/org/apache/james/pop3server/mailbox/task/MessageInconsistenciesEntry.java
##########
@@ -0,0 +1,83 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.pop3server.mailbox.task;
+
+import java.util.Objects;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class MessageInconsistenciesEntry {
+
+    public interface Builder {
+        @FunctionalInterface
+        interface RequireMailboxId {
+            RequireMessageId mailboxId(String mailboxId);
+        }
+
+        @FunctionalInterface
+        interface RequireMessageId {
+            MessageInconsistenciesEntry messageId(String messageId);
+        }
+
+        @FunctionalInterface
+        interface RequireMessageUid {
+            MessageInconsistenciesEntry messageUid(Long messageUid);
+        }
+    }
+
+    public static Builder.RequireMailboxId builder() {
+        return mailboxId -> messageId -> new 
MessageInconsistenciesEntry(mailboxId, messageId);
+    }
+
+    private final String mailboxId;
+    private final String messageId;
+
+    MessageInconsistenciesEntry(@JsonProperty("mailboxId") String mailboxId,
+                                        @JsonProperty("messageId") String 
messageId) {

Review comment:
       indent

##########
File path: 
server/protocols/protocols-pop3-distributed/src/test/java/org/apache/james/pop3server/mailbox/DistributedPop3ServerTest.java
##########
@@ -0,0 +1,157 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.pop3server.mailbox;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.net.InetSocketAddress;
+import java.util.List;
+
+import org.apache.commons.net.pop3.POP3Client;
+import org.apache.commons.net.pop3.POP3MessageInfo;
+import org.apache.james.core.Username;
+import org.apache.james.filesystem.api.FileSystem;
+import org.apache.james.filesystem.api.mock.MockFileSystem;
+import org.apache.james.mailbox.MailboxManager;
+import org.apache.james.mailbox.MailboxSession;
+import org.apache.james.mailbox.MessageIdManager;
+import org.apache.james.mailbox.MessageManager;
+import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
+import org.apache.james.mailbox.model.FetchGroup;
+import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.model.MessageId;
+import org.apache.james.mailbox.model.MessageRange;
+import org.apache.james.metrics.api.MetricFactory;
+import org.apache.james.metrics.tests.RecordingMetricFactory;
+import org.apache.james.pop3server.POP3ServerTest;
+import org.apache.james.pop3server.POP3TestConfiguration;
+import org.apache.james.pop3server.netty.POP3Server;
+import org.apache.james.protocols.api.utils.ProtocolServerUtils;
+import org.apache.james.protocols.lib.mock.MockProtocolHandlerLoader;
+import org.apache.james.user.api.UsersRepository;
+import org.apache.james.user.api.UsersRepositoryException;
+import org.jboss.netty.util.HashedWheelTimer;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.inject.name.Names;
+
+public class DistributedPop3ServerTest extends POP3ServerTest {
+    protected void setUpServiceManager() throws Exception {
+        InMemoryIntegrationResources memoryIntegrationResources = 
InMemoryIntegrationResources.builder()
+            .authenticator((userid, passwd) -> {
+                try {
+                    return usersRepository.test(userid, passwd.toString());
+                } catch (UsersRepositoryException e) {
+                    e.printStackTrace();
+                    return false;
+                }
+            })
+            .fakeAuthorizator()
+            .inVmEventBus()
+            .defaultAnnotationLimits()
+            .defaultMessageParser()
+            .scanningSearchIndex()
+            .noPreDeletionHooks()
+            .storeQuotaManager()
+            .build();
+        mailboxManager = memoryIntegrationResources
+            .getMailboxManager();
+        fileSystem = new MockFileSystem();
+        MemoryPop3MetadataStore metadataStore = new MemoryPop3MetadataStore();
+        mailboxManager.getEventBus().register(
+            new PopulateMetadataStoreListener(metadataStore));
+
+        protocolHandlerChain = MockProtocolHandlerLoader.builder()
+            .put(binder -> 
binder.bind(UsersRepository.class).toInstance(usersRepository))
+            .put(binder -> 
binder.bind(MailboxManager.class).annotatedWith(Names.named("mailboxmanager")).toInstance(mailboxManager))
+            .put(binder -> 
binder.bind(FileSystem.class).toInstance(fileSystem))
+            .put(binder -> 
binder.bind(MailboxAdapterFactory.class).to(DistributedMailboxAdapter.Factory.class))
+            .put(binder -> 
binder.bind(MessageIdManager.class).toInstance(memoryIntegrationResources.getMessageIdManager()))
+            .put(binder -> 
binder.bind(MessageId.Factory.class).toInstance(memoryIntegrationResources.getMessageIdFactory()))
+            .put(binder -> 
binder.bind(MetricFactory.class).to(RecordingMetricFactory.class))
+            .put(binder -> 
binder.bind(Pop3MetadataStore.class).toInstance(metadataStore))
+            .build();
+    }
+
+    @Nested
+    class DocaposteTests {

Review comment:
       `DocaposteTests`?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to