Start 6.0 version
* Upgrade to Java 17, SF-6.0, Gradle 7.2 * Upgrade to Jakarta dependencies and respective namespaces * Fix some tests for Java 17 compatibility * Fix wrong Javadocs * Add some missed Javadocs * Fix more `jakarta` namespace * Fix WS & XML modules to use Jakarta EE * `--add-opens` in some modules for their reflection-based tests * Disable Kafka tests which does not work on Windows; see Apache Kafka `3.0.1` * Upgrade to JUnit `5.8.1` * Migrate JMS tests to Artemis * Remove RMI module as it was deprecated before * Fix `pr-build-workflow.yml` for Java 17 * Fix JavaDocs warnings using `Xdoclint:syntax` per module, not in the top-level `api` task * Move docs for version `6.0`
This commit is contained in:
@@ -28,18 +28,18 @@ import java.util.Properties;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import javax.mail.Authenticator;
|
||||
import javax.mail.FetchProfile;
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Multipart;
|
||||
import javax.mail.Part;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.Store;
|
||||
import javax.mail.URLName;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Authenticator;
|
||||
import jakarta.mail.FetchProfile;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.Part;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.Store;
|
||||
import jakarta.mail.URLName;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.expression.Expression;
|
||||
@@ -359,7 +359,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] receive() throws javax.mail.MessagingException {
|
||||
public Object[] receive() throws jakarta.mail.MessagingException {
|
||||
this.folderReadLock.lock(); // NOSONAR - guarded with the getReadHoldCount()
|
||||
try {
|
||||
try {
|
||||
@@ -574,7 +574,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
|
||||
/**
|
||||
* Fetches the specified messages from this receiver's folder. Default
|
||||
* implementation {@link Folder#fetch(Message[], FetchProfile) fetches}
|
||||
* every {@link javax.mail.FetchProfile.Item}.
|
||||
* every {@link jakarta.mail.FetchProfile.Item}.
|
||||
* @param messages the messages to fetch
|
||||
* @throws MessagingException in case of JavaMail errors
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,9 +23,9 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.MessagingException;
|
||||
|
||||
import org.aopalliance.aop.Advice;
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.springframework.util.CollectionUtils;
|
||||
* An event-driven Channel Adapter that receives mail messages from a mail
|
||||
* server that supports the IMAP "idle" command (see RFC 2177). Received mail
|
||||
* messages will be converted and sent as Spring Integration Messages to the
|
||||
* output channel. The Message payload will be the {@link javax.mail.Message}
|
||||
* output channel. The Message payload will be the {@link jakarta.mail.Message}
|
||||
* instance that was received.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
@@ -116,7 +116,7 @@ public class ImapIdleChannelAdapter extends MessageProducerSupport implements Be
|
||||
|
||||
/**
|
||||
* Specify whether the IDLE task should reconnect automatically after
|
||||
* catching a {@link javax.mail.FolderClosedException} while waiting for messages. The
|
||||
* catching a {@link jakarta.mail.FolderClosedException} while waiting for messages. The
|
||||
* default value is <code>true</code>.
|
||||
* @param shouldReconnectAutomatically true to reconnect.
|
||||
*/
|
||||
|
||||
@@ -22,15 +22,15 @@ import java.util.Objects;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Flags.Flag;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.search.AndTerm;
|
||||
import javax.mail.search.FlagTerm;
|
||||
import javax.mail.search.NotTerm;
|
||||
import javax.mail.search.SearchTerm;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Flags.Flag;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.search.AndTerm;
|
||||
import jakarta.mail.search.FlagTerm;
|
||||
import jakarta.mail.search.NotTerm;
|
||||
import jakarta.mail.search.SearchTerm;
|
||||
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
@@ -201,9 +201,9 @@ public class ImapMailReceiver extends AbstractMailReceiver {
|
||||
/**
|
||||
* Retrieves new messages from this receiver's folder. This implementation
|
||||
* creates a {@link SearchTerm} that searches for all messages in the
|
||||
* folder that are {@link javax.mail.Flags.Flag#RECENT RECENT}, not
|
||||
* {@link javax.mail.Flags.Flag#ANSWERED ANSWERED}, and not
|
||||
* {@link javax.mail.Flags.Flag#DELETED DELETED}. The search term is used
|
||||
* folder that are {@link jakarta.mail.Flags.Flag#RECENT RECENT}, not
|
||||
* {@link jakarta.mail.Flags.Flag#ANSWERED ANSWERED}, and not
|
||||
* {@link jakarta.mail.Flags.Flag#DELETED DELETED}. The search term is used
|
||||
* to {@link Folder#search(SearchTerm) search} for new messages.
|
||||
* @return the new messages
|
||||
* @throws MessagingException in case of JavaMail errors
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,13 +17,14 @@
|
||||
package org.springframework.integration.mail;
|
||||
|
||||
/**
|
||||
* Strategy interface for receiving mail {@link javax.mail.Message Messages}.
|
||||
* Strategy interface for receiving mail {@link jakarta.mail.Message Messages}.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
*/
|
||||
public interface MailReceiver {
|
||||
|
||||
Object[] receive() throws javax.mail.MessagingException;
|
||||
Object[] receive() throws jakarta.mail.MessagingException;
|
||||
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
package org.springframework.integration.mail;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.core.io.ByteArrayResource;
|
||||
import org.springframework.integration.handler.AbstractMessageHandler;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007-2020 the original author or authors.
|
||||
* Copyright 2007-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,10 +16,10 @@
|
||||
|
||||
package org.springframework.integration.mail;
|
||||
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Service;
|
||||
import javax.mail.URLName;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.Service;
|
||||
import jakarta.mail.URLName;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
@@ -43,8 +43,8 @@ public abstract class MailTransportUtils {
|
||||
* <code>finally</code>
|
||||
* blocks in manual JavaMail code.
|
||||
* @param service the JavaMail Service to close (may be <code>null</code>)
|
||||
* @see javax.mail.Transport
|
||||
* @see javax.mail.Store
|
||||
* @see jakarta.mail.Transport
|
||||
* @see jakarta.mail.Store
|
||||
*/
|
||||
public static void closeService(Service service) {
|
||||
if (service != null) {
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package org.springframework.integration.mail;
|
||||
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.URLName;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.URLName;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package org.springframework.integration.mail;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.search.SearchTerm;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.search.SearchTerm;
|
||||
|
||||
/**
|
||||
* Strategy to be used to generate a {@link SearchTerm}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,10 +18,10 @@ package org.springframework.integration.mail.config;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.Authenticator;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.URLName;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Authenticator;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.URLName;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
|
||||
@@ -26,9 +26,9 @@ import java.util.concurrent.Executor;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.mail.Authenticator;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Authenticator;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.aopalliance.aop.Advice;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ImapIdleChannelAdapterSpec
|
||||
|
||||
/**
|
||||
* Configure a SpEL expression to select messages. The root object for the expression
|
||||
* evaluation is a {@link javax.mail.internet.MimeMessage} which should return a boolean
|
||||
* evaluation is a {@link jakarta.mail.internet.MimeMessage} which should return a boolean
|
||||
* result (true means select the message).
|
||||
* @param selectorExpression the selectorExpression.
|
||||
* @return the spec.
|
||||
@@ -94,7 +94,7 @@ public class ImapIdleChannelAdapterSpec
|
||||
|
||||
/**
|
||||
* Configure an {@link Expression} to select messages. The root object for the expression
|
||||
* evaluation is a {@link javax.mail.internet.MimeMessage} which should return a boolean
|
||||
* evaluation is a {@link jakarta.mail.internet.MimeMessage} which should return a boolean
|
||||
* result (true means select the message).
|
||||
* @param selectorExpression the selectorExpression.
|
||||
* @return the spec.
|
||||
@@ -112,7 +112,7 @@ public class ImapIdleChannelAdapterSpec
|
||||
|
||||
/**
|
||||
* Configure a {@link Function} to select messages. The argument for the function
|
||||
* is a {@link javax.mail.internet.MimeMessage}; {@code apply} returns a boolean
|
||||
* is a {@link jakarta.mail.internet.MimeMessage}; {@code apply} returns a boolean
|
||||
* result (true means select the message).
|
||||
* @param selectorFunction the selectorFunction.
|
||||
* @return the spec.
|
||||
@@ -252,9 +252,9 @@ public class ImapIdleChannelAdapterSpec
|
||||
|
||||
/**
|
||||
* When a header mapper is provided determine whether an embedded
|
||||
* {@link javax.mail.Part} (e.g {@link javax.mail.Message} or
|
||||
* {@link javax.mail.Multipart} content is rendered as a byte[] in the payload.
|
||||
* Otherwise, leave as a {@link javax.mail.Part}. These objects are not suitable for
|
||||
* {@link jakarta.mail.Part} (e.g {@link jakarta.mail.Message} or
|
||||
* {@link jakarta.mail.Multipart} content is rendered as a byte[] in the payload.
|
||||
* Otherwise, leave as a {@link jakarta.mail.Part}. These objects are not suitable for
|
||||
* downstream serialization. Default: true.
|
||||
* <p>
|
||||
* This has no effect if there is no header mapper, in that case the payload is the
|
||||
|
||||
@@ -22,9 +22,9 @@ import java.util.Properties;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.mail.Authenticator;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Authenticator;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.expression.Expression;
|
||||
import org.springframework.integration.dsl.ComponentsRegistration;
|
||||
@@ -70,7 +70,7 @@ MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S, R>, R e
|
||||
|
||||
/**
|
||||
* Configure a SpEL expression to select messages. The root object for the expression
|
||||
* evaluation is a {@link javax.mail.internet.MimeMessage} which should return a boolean
|
||||
* evaluation is a {@link jakarta.mail.internet.MimeMessage} which should return a boolean
|
||||
* result (true means select the message).
|
||||
* @param selectorExpression the selectorExpression.
|
||||
* @return the spec.
|
||||
@@ -88,7 +88,7 @@ MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S, R>, R e
|
||||
|
||||
/**
|
||||
* Configure a SpEL expression to select messages. The root object for the expression
|
||||
* evaluation is a {@link javax.mail.internet.MimeMessage} which should return a boolean
|
||||
* evaluation is a {@link jakarta.mail.internet.MimeMessage} which should return a boolean
|
||||
* result (true means select the message).
|
||||
* @param selectorExpression the selectorExpression.
|
||||
* @return the spec.
|
||||
@@ -101,7 +101,7 @@ MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S, R>, R e
|
||||
|
||||
/**
|
||||
* Configure a {@link Function} to select messages. The argument for the function
|
||||
* is a {@link javax.mail.internet.MimeMessage}; {@code apply} returns a boolean
|
||||
* is a {@link jakarta.mail.internet.MimeMessage}; {@code apply} returns a boolean
|
||||
* result (true means select the message).
|
||||
* @param selectorFunction the selectorFunction.
|
||||
* @return the spec.
|
||||
@@ -225,9 +225,9 @@ MailInboundChannelAdapterSpec<S extends MailInboundChannelAdapterSpec<S, R>, R e
|
||||
|
||||
/**
|
||||
* When a header mapper is provided determine whether an embedded
|
||||
* {@link javax.mail.Part} (e.g {@link javax.mail.Message} or
|
||||
* {@link javax.mail.Multipart} content is rendered as a byte[] in the payload.
|
||||
* Otherwise, leave as a {@link javax.mail.Part}. These objects are not suitable for
|
||||
* {@link jakarta.mail.Part} (e.g {@link jakarta.mail.Message} or
|
||||
* {@link jakarta.mail.Multipart} content is rendered as a byte[] in the payload.
|
||||
* Otherwise, leave as a {@link jakarta.mail.Part}. These objects are not suitable for
|
||||
* downstream serialization. Default: true.
|
||||
* <p> This has no effect if there is no header mapper, in that case the payload is the
|
||||
* {@link MimeMessage}.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2020 the original author or authors.
|
||||
* Copyright 2014-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,7 +19,7 @@ package org.springframework.integration.mail.dsl;
|
||||
import java.util.Properties;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.activation.FileTypeMap;
|
||||
import jakarta.activation.FileTypeMap;
|
||||
|
||||
import org.springframework.integration.dsl.MessageHandlerSpec;
|
||||
import org.springframework.integration.mail.MailSendingMessageHandler;
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.mail.Header;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Header;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.integration.mail.MailHeaders;
|
||||
import org.springframework.integration.mapping.HeaderMapper;
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.springframework.integration.mail.support;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.mail.Address;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.Message.RecipientType;
|
||||
import jakarta.mail.Address;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.Message.RecipientType;
|
||||
|
||||
import org.springframework.integration.mail.MailHeaders;
|
||||
import org.springframework.messaging.MessagingException;
|
||||
|
||||
@@ -67,11 +67,11 @@ public abstract class AbstractMailMessageTransformer<T> implements Transformer,
|
||||
@Override
|
||||
public Message<?> transform(Message<?> message) {
|
||||
Object payload = message.getPayload();
|
||||
if (!(payload instanceof javax.mail.Message)) {
|
||||
if (!(payload instanceof jakarta.mail.Message)) {
|
||||
throw new MessageTransformationException(message, getClass().getSimpleName()
|
||||
+ " requires a javax.mail.Message payload");
|
||||
+ " requires a jakarta.mail.Message payload");
|
||||
}
|
||||
javax.mail.Message mailMessage = (javax.mail.Message) payload;
|
||||
jakarta.mail.Message mailMessage = (jakarta.mail.Message) payload;
|
||||
AbstractIntegrationMessageBuilder<T> builder;
|
||||
try {
|
||||
builder = this.doTransform(mailMessage);
|
||||
@@ -86,11 +86,11 @@ public abstract class AbstractMailMessageTransformer<T> implements Transformer,
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
protected abstract AbstractIntegrationMessageBuilder<T> doTransform(javax.mail.Message mailMessage)
|
||||
protected abstract AbstractIntegrationMessageBuilder<T> doTransform(jakarta.mail.Message mailMessage)
|
||||
throws Exception; // NOSONAR
|
||||
|
||||
|
||||
private static Map<String, Object> extractHeaderMapFromMailMessage(javax.mail.Message mailMessage) {
|
||||
private static Map<String, Object> extractHeaderMapFromMailMessage(jakarta.mail.Message mailMessage) {
|
||||
return MailUtils.extractStandardHeaders(mailMessage);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ package org.springframework.integration.mail.transformer;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import javax.mail.Multipart;
|
||||
import javax.mail.Part;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.Part;
|
||||
|
||||
import org.springframework.integration.support.AbstractIntegrationMessageBuilder;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Transforms a Message payload of type {@link javax.mail.Message} to a String. If the
|
||||
* Transforms a Message payload of type {@link jakarta.mail.Message} to a String. If the
|
||||
* mail message's content is a String, it will be the payload of the result Message. If
|
||||
* the content is a Part or Multipart, a String will be created from an output stream of
|
||||
* bytes using the provided charset (or UTF-8 by default).
|
||||
@@ -51,7 +51,7 @@ public class MailToStringTransformer extends AbstractMailMessageTransformer<Stri
|
||||
}
|
||||
|
||||
@Override
|
||||
protected AbstractIntegrationMessageBuilder<String> doTransform(javax.mail.Message mailMessage)
|
||||
protected AbstractIntegrationMessageBuilder<String> doTransform(jakarta.mail.Message mailMessage)
|
||||
throws Exception { // NOSONAR
|
||||
|
||||
Object content = mailMessage.getContent();
|
||||
|
||||
@@ -213,12 +213,12 @@
|
||||
<xsd:attribute name="session" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Specify the javax.mail.Session reference.
|
||||
Specify the jakarta.mail.Session reference.
|
||||
NOTE: if this is provided, then 'java-mail-properties' should not be.
|
||||
</xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="javax.mail.Session"/>
|
||||
<tool:expected-type type="jakarta.mail.Session"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
@@ -239,12 +239,12 @@
|
||||
<xsd:attribute name="authenticator" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Specify the javax.mail.Authenticator.
|
||||
Specify the jakarta.mail.Authenticator.
|
||||
NOTE: if this is provided, then 'session' should not be.
|
||||
</xsd:documentation>
|
||||
<xsd:appinfo>
|
||||
<tool:annotation kind="ref">
|
||||
<tool:expected-type type="javax.mail.Authenticator"/>
|
||||
<tool:expected-type type="jakarta.mail.Authenticator"/>
|
||||
</tool:annotation>
|
||||
</xsd:appinfo>
|
||||
</xsd:annotation>
|
||||
@@ -309,7 +309,7 @@
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
Defines a Transformer ('org.springframework.integration.mail.transformer.MailToStringTransformer')
|
||||
that converts a javax.mail.Message payload to a String.
|
||||
that converts a jakarta.mail.Message payload to a String.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:complexContent>
|
||||
|
||||
@@ -45,21 +45,21 @@ import java.util.logging.Level;
|
||||
import java.util.logging.LogManager;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Flags.Flag;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.FolderClosedException;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Multipart;
|
||||
import javax.mail.Store;
|
||||
import javax.mail.URLName;
|
||||
import javax.mail.internet.AddressException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.mail.search.AndTerm;
|
||||
import javax.mail.search.FlagTerm;
|
||||
import javax.mail.search.FromTerm;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Flags.Flag;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.FolderClosedException;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.Store;
|
||||
import jakarta.mail.URLName;
|
||||
import jakarta.mail.internet.AddressException;
|
||||
import jakarta.mail.internet.InternetAddress;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
import jakarta.mail.search.AndTerm;
|
||||
import jakarta.mail.search.FlagTerm;
|
||||
import jakarta.mail.search.FromTerm;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
@@ -797,7 +797,7 @@ public class ImapMailReceiverTests {
|
||||
try {
|
||||
receiver.receive();
|
||||
}
|
||||
catch (javax.mail.MessagingException e) {
|
||||
catch (jakarta.mail.MessagingException e) {
|
||||
if (e.getCause() instanceof NullPointerException) {
|
||||
failed.getAndIncrement();
|
||||
}
|
||||
|
||||
@@ -24,13 +24,13 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Flags.Flag;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.search.AndTerm;
|
||||
import javax.mail.search.FlagTerm;
|
||||
import javax.mail.search.NotTerm;
|
||||
import javax.mail.search.SearchTerm;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Flags.Flag;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.search.AndTerm;
|
||||
import jakarta.mail.search.FlagTerm;
|
||||
import jakarta.mail.search.NotTerm;
|
||||
import jakarta.mail.search.SearchTerm;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.Store;
|
||||
import javax.mail.URLName;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.Store;
|
||||
import jakarta.mail.URLName;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import java.util.Queue;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import javax.mail.Message;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
@@ -43,9 +43,9 @@ public class MailReceivingMessageSourceTests {
|
||||
MimeMessage message3 = Mockito.mock(MimeMessage.class);
|
||||
MimeMessage message4 = Mockito.mock(MimeMessage.class);
|
||||
|
||||
mailReceiver.messages.add(new javax.mail.Message[]{ message1 });
|
||||
mailReceiver.messages.add(new javax.mail.Message[]{ message2, message3 });
|
||||
mailReceiver.messages.add(new javax.mail.Message[]{ message4 });
|
||||
mailReceiver.messages.add(new jakarta.mail.Message[]{ message1 });
|
||||
mailReceiver.messages.add(new jakarta.mail.Message[]{ message2, message3 });
|
||||
mailReceiver.messages.add(new jakarta.mail.Message[]{ message4 });
|
||||
|
||||
MailReceivingMessageSource source = new MailReceivingMessageSource(mailReceiver);
|
||||
assertThat(source.receive().getPayload()).as("Wrong message for number 1").isEqualTo(message1);
|
||||
@@ -66,7 +66,7 @@ public class MailReceivingMessageSourceTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public javax.mail.Message[] receive() {
|
||||
public jakarta.mail.Message[] receive() {
|
||||
return messages.poll();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
<bean id="javaMailSender" class="org.springframework.integration.mail.StubJavaMailSender">
|
||||
<constructor-arg>
|
||||
<bean class="javax.mail.internet.MimeMessage">
|
||||
<constructor-arg type="javax.mail.Session">
|
||||
<bean class="jakarta.mail.internet.MimeMessage">
|
||||
<constructor-arg type="jakarta.mail.Session">
|
||||
<null/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
@@ -21,9 +21,9 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
|
||||
import javax.mail.Message;
|
||||
import javax.mail.Multipart;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -20,10 +20,10 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
|
||||
import javax.mail.Message;
|
||||
import javax.mail.Multipart;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.Multipart;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
||||
@@ -25,11 +25,11 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Flags.Flag;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Flags.Flag;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.springframework.mail.MailException;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
<bean id="mailSender" class="org.springframework.integration.mail.StubJavaMailSender">
|
||||
<constructor-arg>
|
||||
<bean class="javax.mail.internet.MimeMessage">
|
||||
<constructor-arg type="javax.mail.Session"><null/></constructor-arg>
|
||||
<bean class="jakarta.mail.internet.MimeMessage">
|
||||
<constructor-arg type="jakarta.mail.Session"><null/></constructor-arg>
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
@@ -20,10 +20,10 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.URLName;
|
||||
import javax.mail.search.SearchTerm;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.URLName;
|
||||
import jakarta.mail.search.SearchTerm;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.Message;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.Message;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
store-uri="imap:test" session="testSession" channel="testChannel"
|
||||
should-delete-messages="false" auto-startup="false" />
|
||||
|
||||
<bean id="testSession" class="javax.mail.Session" factory-method="getInstance">
|
||||
<bean id="testSession" class="jakarta.mail.Session" factory-method="getInstance">
|
||||
<constructor-arg>
|
||||
<props>
|
||||
<prop key="foo">bar</prop>
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.integration.mail.config;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
import javax.mail.Authenticator;
|
||||
import jakarta.mail.Authenticator;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.xml.sax.SAXParseException;
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.integration.mail.config;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mockito;
|
||||
@@ -49,7 +49,7 @@ class MailToStringTransformerParserTests {
|
||||
(PollableChannel) new BeanFactoryChannelResolver(context).resolveDestination("output");
|
||||
MimeMessage mimeMessage = Mockito.mock(MimeMessage.class);
|
||||
Mockito.when(mimeMessage.getContent()).thenReturn("hello");
|
||||
input.send(new GenericMessage<javax.mail.Message>(mimeMessage));
|
||||
input.send(new GenericMessage<jakarta.mail.Message>(mimeMessage));
|
||||
Message<?> result = output.receive(10_000);
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getPayload()).isEqualTo("hello");
|
||||
@@ -67,7 +67,7 @@ class MailToStringTransformerParserTests {
|
||||
(PollableChannel) new BeanFactoryChannelResolver(context).resolveDestination("output");
|
||||
MimeMessage mimeMessage = Mockito.mock(MimeMessage.class);
|
||||
Mockito.when(mimeMessage.getContent()).thenReturn("foo");
|
||||
input.send(new GenericMessage<javax.mail.Message>(mimeMessage));
|
||||
input.send(new GenericMessage<jakarta.mail.Message>(mimeMessage));
|
||||
Message<?> result = output.receive(0);
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getPayload()).isEqualTo("FOO!!!");
|
||||
|
||||
@@ -27,8 +27,8 @@ import java.io.FileReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.Session;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Session;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@@ -20,7 +20,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.URLName;
|
||||
import jakarta.mail.URLName;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.mail.Message.RecipientType;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Message.RecipientType;
|
||||
import jakarta.mail.MessagingException;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
||||
@@ -18,9 +18,9 @@ package org.springframework.integration.mail.config;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import javax.mail.Message.RecipientType;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import jakarta.mail.Message.RecipientType;
|
||||
import jakarta.mail.internet.InternetAddress;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
<bean id="mailSender" class="org.springframework.integration.mail.StubJavaMailSender">
|
||||
<constructor-arg>
|
||||
<bean class="javax.mail.internet.MimeMessage">
|
||||
<constructor-arg type="javax.mail.Session"><null/></constructor-arg>
|
||||
<bean class="jakarta.mail.internet.MimeMessage">
|
||||
<constructor-arg type="jakarta.mail.Session"><null/></constructor-arg>
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
@@ -21,16 +21,16 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
import java.io.Closeable;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.mail.Flags;
|
||||
import javax.mail.Folder;
|
||||
import javax.mail.internet.AddressException;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import javax.mail.internet.MimeMessage.RecipientType;
|
||||
import javax.mail.search.AndTerm;
|
||||
import javax.mail.search.FlagTerm;
|
||||
import javax.mail.search.FromTerm;
|
||||
import javax.mail.search.SearchTerm;
|
||||
import jakarta.mail.Flags;
|
||||
import jakarta.mail.Folder;
|
||||
import jakarta.mail.internet.AddressException;
|
||||
import jakarta.mail.internet.InternetAddress;
|
||||
import jakarta.mail.internet.MimeMessage;
|
||||
import jakarta.mail.internet.MimeMessage.RecipientType;
|
||||
import jakarta.mail.search.AndTerm;
|
||||
import jakarta.mail.search.FlagTerm;
|
||||
import jakarta.mail.search.FromTerm;
|
||||
import jakarta.mail.search.SearchTerm;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
||||
Reference in New Issue
Block a user