File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
spring-integration-mail/src
main/java/org/springframework/integration/mail
test/java/org/springframework/integration/mail Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2024 the original author or authors.
2+ * Copyright 2002-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
6868 * @author Dominik Simmen
6969 * @author Yuxin Wang
7070 * @author Filip Hrisafov
71+ * @author Jiandong Ma
7172 */
7273public abstract class AbstractMailReceiver extends IntegrationObjectSupport implements MailReceiver , DisposableBean {
7374
@@ -357,6 +358,9 @@ protected void openFolder() throws MessagingException {
357358 }
358359
359360 private Folder obtainFolderInstance () throws MessagingException {
361+ if (this .url == null ) {
362+ return this .store .getDefaultFolder ();
363+ }
360364 return this .store .getFolder (this .url );
361365 }
362366
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2022 the original author or authors.
2+ * Copyright 2014-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2222import jakarta .mail .Message ;
2323import jakarta .mail .Session ;
2424import jakarta .mail .Store ;
25- import jakarta .mail .URLName ;
2625import org .junit .jupiter .api .Test ;
2726
2827import org .springframework .beans .DirectFieldAccessor ;
@@ -68,7 +67,7 @@ protected Message[] searchForNewMessages() {
6867 Folder folder = mock (Folder .class );
6968 when (folder .exists ()).thenReturn (true );
7069 when (folder .isOpen ()).thenReturn (false , true );
71- doReturn (folder ).when (store ).getFolder (( URLName ) null );
70+ doReturn (folder ).when (store ).getDefaultFolder ( );
7271 doNothing ().when (store ).connect ();
7372 receiver .openFolder ();
7473 receiver .openFolder ();
You can’t perform that action at this time.
0 commit comments