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 1
1
/*
2
- * Copyright 2002-2024 the original author or authors.
2
+ * Copyright 2002-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
69
69
* @author Yuxin Wang
70
70
* @author Ngoc Nhan
71
71
* @author Filip Hrisafov
72
+ * @author Jiandong Ma
72
73
*/
73
74
public abstract class AbstractMailReceiver extends IntegrationObjectSupport implements MailReceiver , DisposableBean {
74
75
@@ -370,6 +371,9 @@ protected void openFolder() throws MessagingException {
370
371
}
371
372
372
373
private Folder obtainFolderInstance () throws MessagingException {
374
+ if (this .url == null ) {
375
+ return this .store .getDefaultFolder ();
376
+ }
373
377
return this .store .getFolder (this .url );
374
378
}
375
379
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2014-2022 the original author or authors.
2
+ * Copyright 2014-2025 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
22
22
import jakarta .mail .Message ;
23
23
import jakarta .mail .Session ;
24
24
import jakarta .mail .Store ;
25
- import jakarta .mail .URLName ;
26
25
import org .junit .jupiter .api .Test ;
27
26
28
27
import org .springframework .beans .DirectFieldAccessor ;
@@ -68,7 +67,7 @@ protected Message[] searchForNewMessages() {
68
67
Folder folder = mock (Folder .class );
69
68
when (folder .exists ()).thenReturn (true );
70
69
when (folder .isOpen ()).thenReturn (false , true );
71
- doReturn (folder ).when (store ).getFolder (( URLName ) null );
70
+ doReturn (folder ).when (store ).getDefaultFolder ( );
72
71
doNothing ().when (store ).connect ();
73
72
receiver .openFolder ();
74
73
receiver .openFolder ();
You can’t perform that action at this time.
0 commit comments