You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2019/12/15 18:19:38 UTC

[sling-org-apache-sling-commons-messaging-mail] 02/03: SLING-5644 Provide a messaging implementation based on Commons Email

This is an automated email from the ASF dual-hosted git repository.

olli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-messaging-mail.git

commit 04518e828ee05a22068d70c6dd7db591afa85466
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Sun Dec 15 19:15:52 2019 +0100

    SLING-5644 Provide a messaging implementation based on Commons Email
    
    Remove files related to Commons Email approach
---
 .../sling/commons/messaging/mail/MailBuilder.java  |  33 ------
 .../sling/commons/messaging/mail/MailResult.java   |  41 --------
 .../sling/commons/messaging/mail/MailUtil.java     |  36 -------
 .../messaging/mail/internal/SimpleMailBuilder.java | 109 --------------------
 .../internal/SimpleMailBuilderConfiguration.java   |  73 --------------
 .../messaging/mail/MailBuilderConfigurations.java  |  52 ----------
 .../commons/messaging/mail/MailTestSupport.java    |  99 ------------------
 .../mail/internal/SimpleMailBuilderIT.java         |  93 -----------------
 .../mail/internal/SimpleMailServiceIT.java         | 112 ---------------------
 9 files changed, 648 deletions(-)

diff --git a/src/main/java/org/apache/sling/commons/messaging/mail/MailBuilder.java b/src/main/java/org/apache/sling/commons/messaging/mail/MailBuilder.java
deleted file mode 100644
index 1ad38ed..0000000
--- a/src/main/java/org/apache/sling/commons/messaging/mail/MailBuilder.java
+++ /dev/null
@@ -1,33 +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.sling.commons.messaging.mail;
-
-import java.util.Map;
-
-import org.apache.commons.mail.Email;
-import org.apache.commons.mail.EmailException;
-import org.jetbrains.annotations.NotNull;
-import org.osgi.annotation.versioning.ProviderType;
-
-@ProviderType
-public interface MailBuilder {
-
-    Email build(@NotNull final String message, @NotNull final String recipient, @NotNull final Map data) throws EmailException;
-
-}
diff --git a/src/main/java/org/apache/sling/commons/messaging/mail/MailResult.java b/src/main/java/org/apache/sling/commons/messaging/mail/MailResult.java
deleted file mode 100644
index c6c1b05..0000000
--- a/src/main/java/org/apache/sling/commons/messaging/mail/MailResult.java
+++ /dev/null
@@ -1,41 +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.sling.commons.messaging.mail;
-
-import org.apache.sling.commons.messaging.Result;
-import org.osgi.annotation.versioning.ConsumerType;
-
-@ConsumerType
-public class MailResult implements Result<byte[]> {
-
-    private final byte[] message;
-
-    public MailResult(final byte[] message) {
-        this.message = message;
-    }
-
-    /**
-     * @return the sent message in <a href="https://tools.ietf.org/html/rfc822">RFC 822</a> format
-     */
-    @Override
-    public byte[] getMessage() {
-        return message;
-    }
-
-}
diff --git a/src/main/java/org/apache/sling/commons/messaging/mail/MailUtil.java b/src/main/java/org/apache/sling/commons/messaging/mail/MailUtil.java
deleted file mode 100644
index d258fe2..0000000
--- a/src/main/java/org/apache/sling/commons/messaging/mail/MailUtil.java
+++ /dev/null
@@ -1,36 +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.sling.commons.messaging.mail;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-
-import javax.mail.MessagingException;
-
-import org.apache.commons.mail.Email;
-
-public class MailUtil {
-
-    public static byte[] toByteArray(final Email email) throws IOException, MessagingException {
-        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        email.getMimeMessage().writeTo(baos);
-        return baos.toByteArray();
-    }
-
-}
diff --git a/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilder.java b/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilder.java
deleted file mode 100644
index 263c71b..0000000
--- a/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilder.java
+++ /dev/null
@@ -1,109 +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.sling.commons.messaging.mail.internal;
-
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.commons.mail.Email;
-import org.apache.commons.mail.EmailException;
-import org.apache.commons.mail.SimpleEmail;
-import org.apache.sling.commons.messaging.mail.MailBuilder;
-import org.jetbrains.annotations.NotNull;
-import org.osgi.framework.Constants;
-import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
-import org.osgi.service.component.annotations.ConfigurationPolicy;
-import org.osgi.service.component.annotations.Modified;
-import org.osgi.service.metatype.annotations.Designate;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@Component(
-    service = MailBuilder.class,
-    property = {
-        Constants.SERVICE_DESCRIPTION + "=Service to build simple mails.",
-        Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
-    },
-    configurationPolicy = ConfigurationPolicy.REQUIRE
-)
-@Designate(
-    ocd = SimpleMailBuilderConfiguration.class
-)
-public class SimpleMailBuilder implements MailBuilder {
-
-    // TODO use encryption and support more configuration options
-
-    private SimpleMailBuilderConfiguration configuration;
-
-    private static final String SUBJECT_KEY = "mail.subject";
-
-    private static final String FROM_KEY = "mail.from";
-
-    private static final String CHARSET_KEY = "mail.charset";
-
-    private static final String SMTP_HOSTNAME_KEY = "mail.smtp.hostname";
-
-    private static final String SMTP_PORT_KEY = "mail.smtp.port";
-
-    private static final String SMTP_USERNAME_KEY = "mail.smtp.username";
-
-    private static final String SMTP_PASSWORD_KEY = "mail.smtp.password";
-
-    private final Logger logger = LoggerFactory.getLogger(SimpleMailBuilder.class);
-
-    public SimpleMailBuilder() {
-    }
-
-    @Activate
-    private void activate(final SimpleMailBuilderConfiguration configuration) {
-        logger.debug("activate");
-        this.configuration = configuration;
-    }
-
-    @Modified
-    private void modified(final SimpleMailBuilderConfiguration configuration) {
-        logger.debug("modified");
-        this.configuration = configuration;
-    }
-
-    @Override
-    public Email build(@NotNull final String message, @NotNull final String recipient, @NotNull final Map data) throws EmailException {
-        final Map configuration = (Map) data.getOrDefault("mail", Collections.EMPTY_MAP);
-        final String subject = (String) configuration.getOrDefault(SUBJECT_KEY, this.configuration.subject());
-        final String from = (String) configuration.getOrDefault(FROM_KEY, this.configuration.from());
-        final String charset = (String) configuration.getOrDefault(CHARSET_KEY, this.configuration.charset());
-        final String smtpHostname = (String) configuration.getOrDefault(SMTP_HOSTNAME_KEY, this.configuration.smtpHostname());
-        final int smtpPort = (Integer) configuration.getOrDefault(SMTP_PORT_KEY, this.configuration.smtpPort());
-        final String smtpUsername = (String) configuration.getOrDefault(SMTP_USERNAME_KEY, this.configuration.smtpUsername());
-        final String smtpPassword = (String) configuration.getOrDefault(SMTP_PASSWORD_KEY, this.configuration.smtpPassword());
-
-        final Email email = new SimpleEmail();
-        email.setCharset(charset);
-        email.setMsg(message);
-        email.addTo(recipient);
-        email.setSubject(subject);
-        email.setFrom(from);
-        email.setHostName(smtpHostname);
-        email.setSmtpPort(smtpPort);
-        email.setAuthentication(smtpUsername, smtpPassword);
-        return email;
-    }
-
-}
diff --git a/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilderConfiguration.java b/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilderConfiguration.java
deleted file mode 100644
index 4801453..0000000
--- a/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilderConfiguration.java
+++ /dev/null
@@ -1,73 +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.sling.commons.messaging.mail.internal;
-
-import org.apache.commons.mail.EmailConstants;
-import org.osgi.service.metatype.annotations.AttributeDefinition;
-import org.osgi.service.metatype.annotations.ObjectClassDefinition;
-
-@ObjectClassDefinition(
-    name = "Apache Sling Commons Messaging Mail “Simple Mail Builder”",
-    description = "simple mail builder for Sling Commons Messaging Mail"
-)
-@interface SimpleMailBuilderConfiguration {
-
-    @AttributeDefinition(
-        name = "subject",
-        description = "default subject for mails"
-    )
-    String subject();
-
-    @AttributeDefinition(
-        name = "from",
-        description = "default from (sender) address for mails"
-    )
-    String from();
-
-    @AttributeDefinition(
-        name = "charset",
-        description = "charset to use for mails"
-    )
-    String charset() default EmailConstants.UTF_8;
-
-    @AttributeDefinition(
-        name = "SMTP hostname",
-        description = "hostname of SMTP server"
-    )
-    String smtpHostname() default "localhost";
-
-    @AttributeDefinition(
-        name = "SMTP port",
-        description = "port of SMTP server"
-    )
-    int smtpPort() default 25;
-
-    @AttributeDefinition(
-        name = "SMTP username",
-        description = "username for SMTP server"
-    )
-    String smtpUsername();
-
-    @AttributeDefinition(
-        name = "SMTP password",
-        description = "password for SMTP server"
-    )
-    String smtpPassword();
-
-}
diff --git a/src/test/java/org/apache/sling/commons/messaging/mail/MailBuilderConfigurations.java b/src/test/java/org/apache/sling/commons/messaging/mail/MailBuilderConfigurations.java
deleted file mode 100644
index 8950f28..0000000
--- a/src/test/java/org/apache/sling/commons/messaging/mail/MailBuilderConfigurations.java
+++ /dev/null
@@ -1,52 +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.sling.commons.messaging.mail;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-public class MailBuilderConfigurations {
-
-    /**
-     * @return minimal configuration properties for building mails
-     */
-    public static Dictionary<String, Object> minimal() {
-        final Dictionary<String, Object> properties = new Hashtable<>();
-        properties.put("subject", "Rudy, A Message to You");
-        properties.put("from", "dandy.livingstone@kingston.jamaica");
-        properties.put("smtpHostname", "localhost");
-        return properties;
-    }
-
-    /**
-     * @param smtpPort SMTP port to use for sending
-     * @return configuration properties including authentication for sending
-     */
-    public static Dictionary<String, Object> full(final int smtpPort) {
-        final Dictionary<String, Object> properties = new Hashtable<>();
-        properties.put("subject", "Testing the Simple Mail Service");
-        properties.put("from", "sender@example.net");
-        properties.put("smtpHostname", "localhost");
-        properties.put("smtpPort", smtpPort);
-        properties.put("smtpUsername", "test");
-        properties.put("smtpPassword", "test");
-        return properties;
-    }
-
-}
diff --git a/src/test/java/org/apache/sling/commons/messaging/mail/MailTestSupport.java b/src/test/java/org/apache/sling/commons/messaging/mail/MailTestSupport.java
deleted file mode 100644
index 834b3b8..0000000
--- a/src/test/java/org/apache/sling/commons/messaging/mail/MailTestSupport.java
+++ /dev/null
@@ -1,99 +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.sling.commons.messaging.mail;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.Dictionary;
-
-import javax.inject.Inject;
-
-import org.ops4j.pax.exam.Option;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationAdmin;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.ops4j.pax.exam.CoreOptions.bundle;
-import static org.ops4j.pax.exam.CoreOptions.junitBundles;
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-import static org.ops4j.pax.exam.CoreOptions.repository;
-import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
-
-public abstract class MailTestSupport {
-
-    @Inject
-    protected BundleContext bundleContext;
-
-    @Inject
-    protected ConfigurationAdmin configurationAdmin;
-
-    protected final Logger logger = LoggerFactory.getLogger(getClass());
-
-    public MailTestSupport() {
-    }
-
-    protected synchronized int findFreePort() {
-        try {
-            final ServerSocket serverSocket = new ServerSocket(0);
-            final int port = serverSocket.getLocalPort();
-            serverSocket.close();
-            return port;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    protected void createFactoryConfiguration(final String factoryPid, final Dictionary<String, Object> properties) throws IOException, InterruptedException {
-        final org.osgi.service.cm.Configuration configuration = configurationAdmin.createFactoryConfiguration(factoryPid);
-        configuration.setBundleLocation(null);
-        configuration.update(properties);
-        Thread.sleep(1000);
-        logger.debug("configuration: {}", configurationAdmin.getConfiguration(factoryPid));
-    }
-
-    protected <T> T getService(Class<T> type) {
-        final ServiceReference<T> serviceReference = bundleContext.getServiceReference(type);
-        return bundleContext.getService(serviceReference);
-    }
-
-    protected Option[] baseConfiguration() {
-        final String filename = System.getProperty("bundle.filename");
-        return options(
-            repository("https://repository.apache.org/snapshots/").id("apache-snapshots").allowSnapshots(),
-            junitBundles(),
-            provision(
-                wrappedBundle(mavenBundle().groupId("org.subethamail").artifactId("subethasmtp").versionAsInProject()),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").versionAsInProject(),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.scr").versionAsInProject(),
-                mavenBundle().groupId("com.sun.mail").artifactId("javax.mail").versionAsInProject(),
-                mavenBundle().groupId("javax.mail").artifactId("javax.mail-api").versionAsInProject(),
-                mavenBundle().groupId("org.apache.commons").artifactId("commons-email").versionAsInProject(),
-                mavenBundle().groupId("org.apache.commons").artifactId("commons-lang3").versionAsInProject(),
-                mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.messaging").versionAsInProject(),
-                mavenBundle().groupId("org.apache.sling").artifactId("org.apache.sling.commons.threads").versionAsInProject(),
-                bundle("reference:file:" + filename)
-            )
-        );
-    }
-
-}
diff --git a/src/test/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilderIT.java b/src/test/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilderIT.java
deleted file mode 100644
index 758a9e9..0000000
--- a/src/test/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailBuilderIT.java
+++ /dev/null
@@ -1,93 +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.sling.commons.messaging.mail.internal;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.mail.Email;
-import org.apache.sling.commons.messaging.mail.MailBuilder;
-import org.apache.sling.commons.messaging.mail.MailBuilderConfigurations;
-import org.apache.sling.commons.messaging.mail.MailTestSupport;
-import org.apache.sling.commons.messaging.mail.MailUtil;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-
-import static org.junit.Assert.assertEquals;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class SimpleMailBuilderIT extends MailTestSupport {
-
-    @Configuration
-    public Option[] configuration() {
-        return baseConfiguration();
-    }
-
-    @Before
-    public void setup() throws Exception {
-        final String factoryPid = "org.apache.sling.commons.messaging.mail.internal.SimpleMailBuilder";
-        final Dictionary<String, Object> properties = MailBuilderConfigurations.minimal();
-        createFactoryConfiguration(factoryPid, properties);
-    }
-
-    @Test
-    public void testBuildWithDefaults() throws Exception {
-        final MailBuilder mailBuilder = getService(MailBuilder.class);
-        final Email email = mailBuilder.build("Stop your messing around, Better think of your future...", "rudy@ghosttown", Collections.emptyMap());
-        email.buildMimeMessage();
-        final byte[] bytes = MailUtil.toByteArray(email);
-        final String mail = new String(bytes, StandardCharsets.UTF_8);
-        logger.debug("mail: " + mail);
-        assertEquals("rudy@ghosttown", email.getToAddresses().get(0).getAddress());
-        assertEquals("Rudy, A Message to You", email.getSubject());
-        assertEquals("dandy.livingstone@kingston.jamaica", email.getFromAddress().getAddress());
-        assertEquals("localhost", email.getHostName());
-        logger.debug(email.getMimeMessage().getContent().toString());
-    }
-
-    @Test
-    public void testBuildWithData() throws Exception {
-        final MailBuilder mailBuilder = getService(MailBuilder.class);
-        final Map<String, String> configuration = new HashMap<>();
-        configuration.put("mail.subject", "Rudy, A Message to You");
-        configuration.put("mail.from", "specials@thespecials.com");
-        final Map data = Collections.singletonMap("mail", configuration);
-        final Email email = mailBuilder.build("A Message to You, Rudy", "rudy@ghosttown", data);
-        email.buildMimeMessage();
-        final byte[] bytes = MailUtil.toByteArray(email);
-        final String mail = new String(bytes, StandardCharsets.UTF_8);
-        logger.debug("mail: " + mail);
-        assertEquals("rudy@ghosttown", email.getToAddresses().get(0).getAddress());
-        assertEquals("Rudy, A Message to You", email.getSubject());
-        assertEquals("specials@thespecials.com", email.getFromAddress().getAddress());
-        assertEquals("localhost", email.getHostName());
-        logger.debug(email.getMimeMessage().getContent().toString());
-    }
-
-}
diff --git a/src/test/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailServiceIT.java b/src/test/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailServiceIT.java
deleted file mode 100644
index 9a8983c..0000000
--- a/src/test/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailServiceIT.java
+++ /dev/null
@@ -1,112 +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.sling.commons.messaging.mail.internal;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-
-import javax.mail.AuthenticationFailedException;
-
-import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.apache.sling.commons.messaging.MessageService;
-import org.apache.sling.commons.messaging.Result;
-import org.apache.sling.commons.messaging.mail.MailBuilderConfigurations;
-import org.apache.sling.commons.messaging.mail.MailResult;
-import org.apache.sling.commons.messaging.mail.MailTestSupport;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Configuration;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
-import org.ops4j.pax.exam.spi.reactors.PerMethod;
-import org.subethamail.wiser.Wiser;
-
-import static org.junit.Assert.assertTrue;
-
-@RunWith(PaxExam.class)
-@ExamReactorStrategy(PerMethod.class)
-public class SimpleMailServiceIT extends MailTestSupport {
-
-    protected Wiser wiser;
-
-    public static final String FACTORY_PID = "org.apache.sling.commons.messaging.mail.internal.SimpleMailBuilder";
-
-    @Configuration
-    public Option[] configuration() {
-        return baseConfiguration();
-    }
-
-    @Before
-    public void setup() throws Exception {
-        final int smtpPort = findFreePort();
-        wiser = new Wiser(smtpPort);
-        wiser.start();
-    }
-
-    @After
-    public void teardown() {
-        wiser.stop();
-        wiser = null;
-    }
-
-    @Test
-    public void send() throws Exception {
-        final Dictionary<String, Object> properties = MailBuilderConfigurations.full(wiser.getServer().getPort());
-        createFactoryConfiguration(FACTORY_PID, properties);
-        final MessageService messageService = getService(MessageService.class);
-        final CompletableFuture<Result> future = messageService.send("simple test message", "recipient@example.net");
-        final MailResult result = (MailResult) future.get();
-        final String message = new String(result.getMessage(), StandardCharsets.UTF_8);
-        logger.info("message: {}", message); // TODO assert
-    }
-
-    @Test
-    public void sendWithData() throws Exception {
-        final Dictionary<String, Object> properties = MailBuilderConfigurations.full(wiser.getServer().getPort());
-        createFactoryConfiguration(FACTORY_PID, properties);
-        final MessageService messageService = getService(MessageService.class);
-        final Map configuration = Collections.singletonMap("mail.subject", "Testing the Simple Mail Service with a custom subject");
-        final Map data = Collections.singletonMap("mail", configuration);
-        final CompletableFuture<Result> future = messageService.send("simple test message", "recipient@example.net", data);
-        final MailResult result = (MailResult) future.get();
-        final String message = new String(result.getMessage(), StandardCharsets.UTF_8);
-        logger.info("message: {}", message); // TODO assert
-    }
-
-    @Test
-    public void sendWithoutAuthentication() throws Exception {
-        final Dictionary<String, Object> properties = MailBuilderConfigurations.minimal();
-        createFactoryConfiguration(FACTORY_PID, properties);
-        final MessageService messageService = getService(MessageService.class);
-        final CompletableFuture<Result> future = messageService.send("simple test message", "recipient@example.net");
-        try {
-            future.get();
-        } catch (Exception e) {
-            logger.info(e.getMessage(), e);
-            assertTrue(ExceptionUtils.getRootCause(e) instanceof AuthenticationFailedException);
-        }
-    }
-
-}