Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/imap connector delete message #388

Merged
merged 6 commits into from
Jan 19, 2024

Conversation

clemensgrosse
Copy link
Collaborator

@clemensgrosse clemensgrosse commented Jan 12, 2024

Description

  • fix of delete message in AbstractInboxConnector
  • deletion of deprecated methods in AbstractInboxConnector
  • adding usage of latest testerra code for MailConnectorTest (current methods of AbstractInboxConnector, PropertyManagerProvider, ASSERT)
  • correcting T11 in MailConnectorTest

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes

Clemens Grosse added 2 commits January 11, 2024 14:23
…nd MailConnectorTest;

removed deprecated methods in AbstractInboxConnector;
marked waitForMails and moveMessage as deprecated in AbstractInboxConnector;
changed return value of getMessageCount from long to int in AbstractInboxConnector;
corrected handling of boolean return value in pDeleteMessage
added usage of PROPERTY_MANAGER in MailConnectorTest, ImapMailConnector and POP3MailConnector;
collapsed catches in ImapMailConnector;
removed Loggable in ImapMailConnector;
changed dataProvider return value in MailConnectorTest;
added usage of returned boolean from deleteMessage in MailConnectorTests;
removed AssertUtils in MailConnectorTest;
corrected testT11_deleteAllMessages in MailConnectorTest;
added usage of query method from AbstractInboxConnector in waitForMessage in MailConnectorTest;
…/imap-connector-delete-message

� Conflicts:
�	mail-connector/src/test/java/eu/tsystems/mms/tic/testframework/mailconnector/test/MailConnectorTest.java
@martingrossmann
Copy link
Contributor

Please recheck the mail connector docs if there is needed an update.

@@ -40,8 +41,9 @@ public class EmailQuery {
*/
private static final String MAX_READ_TRIES_PROPERTY = "MAX_READ_TRIES";

private int retryCount = Integer.parseInt(PropertyManager.getProperty(MAX_READ_TRIES_PROPERTY, "20"));
private long pauseMs = Integer.parseInt(PropertyManager.getProperty(POLLING_TIMER_SECONDS_PROPERTY, "10")) * 1000;
private int retryCount = Integer.parseInt(PROPERTY_MANAGER.getProperty(MAX_READ_TRIES_PROPERTY, "20"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use PROPERTY_MANAGER.getLongProperty(...)

@@ -609,7 +530,8 @@ private boolean pDeleteMessage(final SearchTerm searchTerm, final String folderN
messages = folder.getMessages();
}

log().info("Checking messages from " + getInboxFolder() + " for MessageID:");
final String logMessageSearchTerm = String.format("Checking messages from '%s' for MessageID: '%s'", getInboxFolder(), searchTerm);
log().info(logMessageSearchTerm);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use default logging syntax with {}, e.g. log().info("Checking messages from {}", getInboxFolder())

Clemens Grosse added 2 commits January 12, 2024 12:01
marked deleteMessage deprecated in AbstractInboxConnector;
corrected reading long property in EmailQuery;
added usage of deleteAllMessages() in MailConnectorTest;
reworked waitForMessage in MailConnectorTest;
@@ -42,7 +42,7 @@ public class EmailQuery implements PropertyManagerProvider {
private static final String MAX_READ_TRIES_PROPERTY = "MAX_READ_TRIES";

private int retryCount = Integer.parseInt(PROPERTY_MANAGER.getProperty(MAX_READ_TRIES_PROPERTY, "20"));
private long pauseMs = Integer.parseInt(PROPERTY_MANAGER.getProperty(POLLING_TIMER_SECONDS_PROPERTY, "10")) * 1000L;
private long pauseMs = PROPERTY_MANAGER.getLongProperty(POLLING_TIMER_SECONDS_PROPERTY, "10") * 1000;
Copy link
Contributor

@martingrossmann martingrossmann Jan 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default value should not "10", but 10L

mbeuthan
mbeuthan previously approved these changes Jan 15, 2024
@martingrossmann martingrossmann added this to the 2.7 milestone Jan 17, 2024
@martingrossmann martingrossmann merged commit 5506b56 into master Jan 19, 2024
@martingrossmann martingrossmann deleted the fix/imap-connector-delete-message branch January 19, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants