Skip to content

Fixed the endTime not modified bug to pass sonar cloud tests. #1774

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

Merged

Conversation

Quanzzzz
Copy link
Contributor

@Quanzzzz Quanzzzz commented Apr 11, 2020

Fixed the bug of endTime not modified by plusNanos() by reassigning the modified result to itself;
Added corresponding test to test if the change works;
Modified the stub of mockClock.instant() to make it pass all the tests.

Testing

The reason why stubbing mockClock.instant() is moved ahead of creating timer is that while creating the timer there are two calls of mockClock.instant(). In original version, these two calls were ignored so the startTime and endTime were null and the new added test will fail to this. After changing the position of the stubbing and adding two more values to the stub, all the tests are able to pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Quanzzzz Quanzzzz requested a review from millems April 13, 2020 20:50
Copy link
Contributor

@millems millems left a comment

Choose a reason for hiding this comment

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

Not sure I like this class or how it's implemented, but that's outside of the scope of this review.

@Quanzzzz Quanzzzz merged commit 2fb9aaa into aws:sdk-metrics-development Apr 14, 2020
aws-sdk-java-automation pushed a commit that referenced this pull request Oct 18, 2021
Temporary exclude IVS from JAPICMP because there are approved model changes
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.

2 participants