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

Remove dedicated StringUtils class #249

Merged
merged 7 commits into from
Jul 6, 2022

Conversation

martingrossmann
Copy link
Contributor

@martingrossmann martingrossmann commented Jul 5, 2022

Description

This PR removes the very outdated Testerra StringUtils class and its unit tests. The usage was only internal and it was not documentated. If needed the calls were replaced by the Apache commons lib StringUtils.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

StringUtils.isStringEmpty(actionName)
|| actionName.equals(INIT_STRING)
) {
if (StringUtils.isNotBlank(actionName) || actionName.equals(INIT_STRING)) {
Copy link

Choose a reason for hiding this comment

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

in the old version it is isStringEmpty(), so isNotBlank() will result in another behaviour

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, indeed that was wrong. Fixed that.

final String user = PropertyManager.getProperty(proxyType + ".proxyUser");
if (org.apache.commons.lang3.StringUtils.isNotEmpty(user)) {
final String user = PROPERTY_MANAGER.getProperty(proxyType + ".proxyUser");
if (StringUtils.isNotBlank(user)) {
Copy link

Choose a reason for hiding this comment

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

Changed behaviour. Was isNotEmpty previously. Sanity Check: Intended?
(Same for two more calls below.)

Copy link
Contributor Author

@martingrossmann martingrossmann Jul 5, 2022

Choose a reason for hiding this comment

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

Yes, I don't want to use spaces " " as user. Before it was possible.

@@ -472,7 +473,7 @@ public void testT07_signMessage() {
public void testT08_sendAndWaitForMessageWithoutAttachement_SubjectSenderRecipient() throws Exception {

final String subject = "testT08_sendAndWaitForMessageWithoutAttachement_SubjectSenderRecipient"
+ StringUtils.getRandomStringWithLength(5);
+ RandomStringUtils.random(5, true, false);
Copy link

Choose a reason for hiding this comment

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

Changed behaviour: Old method would only generate [A-Z]^length. (JavaDoc seems to be wrong?)
Sanity Check: Intended?

... The old behaviour was like this even in the first commit, so the documented result might have been the expected one to begin with...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't matter if the test uses a random string with or without a subset of [A-Za-z].

Well, there is no need to use a random string in any MailConnector test method because the subject is already unique by the method name.

@martingrossmann martingrossmann merged commit 7cb070c into master Jul 6, 2022
@martingrossmann martingrossmann deleted the change/remove-stringutils branch July 6, 2022 06:27
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