This is an automated email from the ASF dual-hosted git repository. hqtran pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 4df00960584ff937de28f9d73acd9a6a91dcc9cb Author: Quan Tran <[email protected]> AuthorDate: Thu Sep 18 12:01:20 2025 +0700 [BUILD] [james-server-postgres-app] Compact scanning search tests for Postgres app Start with scanning search is a good enough test. --- ...st.java => PostgresWithScanningSearchTest.java} | 9 +++- .../james/WithScanningSearchMutableTest.java | 56 ---------------------- 2 files changed, 8 insertions(+), 57 deletions(-) diff --git a/server/apps/postgres-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresWithScanningSearchTest.java similarity index 89% rename from server/apps/postgres-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java rename to server/apps/postgres-app/src/test/java/org/apache/james/PostgresWithScanningSearchTest.java index a5e653af6d..9c7545f100 100644 --- a/server/apps/postgres-app/src/test/java/org/apache/james/WithScanningSearchImmutableTest.java +++ b/server/apps/postgres-app/src/test/java/org/apache/james/PostgresWithScanningSearchTest.java @@ -20,12 +20,14 @@ package org.apache.james; import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT; +import static org.assertj.core.api.Assertions.assertThat; import org.apache.james.PostgresJamesConfiguration.EventBusImpl; import org.apache.james.backends.postgres.PostgresExtension; +import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -public class WithScanningSearchImmutableTest implements JamesServerConcreteContract { +public class PostgresWithScanningSearchTest { static PostgresExtension postgresExtension = PostgresExtension.empty(); @RegisterExtension @@ -41,4 +43,9 @@ public class WithScanningSearchImmutableTest implements JamesServerConcreteContr .extension(postgresExtension) .lifeCycle(JamesServerExtension.Lifecycle.PER_CLASS) .build(); + + @Test + void shouldStart(GuiceJamesServer server) { + assertThat(server.isStarted()).isTrue(); + } } diff --git a/server/apps/postgres-app/src/test/java/org/apache/james/WithScanningSearchMutableTest.java b/server/apps/postgres-app/src/test/java/org/apache/james/WithScanningSearchMutableTest.java deleted file mode 100644 index d9c8ef3477..0000000000 --- a/server/apps/postgres-app/src/test/java/org/apache/james/WithScanningSearchMutableTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************** - * 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; - -import static org.apache.james.data.UsersRepositoryModuleChooser.Implementation.DEFAULT; - -import org.apache.james.PostgresJamesConfiguration.EventBusImpl; -import org.apache.james.backends.postgres.PostgresExtension; -import org.apache.james.modules.protocols.ImapGuiceProbe; -import org.apache.james.modules.protocols.SmtpGuiceProbe; -import org.junit.jupiter.api.extension.RegisterExtension; - -public class WithScanningSearchMutableTest implements MailsShouldBeWellReceived { - static PostgresExtension postgresExtension = PostgresExtension.empty(); - - @RegisterExtension - static JamesServerExtension jamesServerExtension = new JamesServerBuilder<PostgresJamesConfiguration>(tmpDir -> - PostgresJamesConfiguration.builder() - .workingDirectory(tmpDir) - .configurationFromClasspath() - .searchConfiguration(SearchConfiguration.scanning()) - .usersRepository(DEFAULT) - .eventBusImpl(EventBusImpl.IN_MEMORY) - .build()) - .server(PostgresJamesServerMain::createServer) - .extension(postgresExtension) - .lifeCycle(JamesServerExtension.Lifecycle.PER_TEST) - .build(); - - @Override - public int imapPort(GuiceJamesServer server) { - return server.getProbe(ImapGuiceProbe.class).getImapPort(); - } - - @Override - public int smtpPort(GuiceJamesServer server) { - return server.getProbe(SmtpGuiceProbe.class).getSmtpPort().getValue(); - } -} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
