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: Support testing nested argument method signatures and 'double' field assertions #1094

Merged
merged 5 commits into from
Nov 18, 2022

Conversation

burkedavison
Copy link
Member

@burkedavison burkedavison commented Nov 14, 2022

  • Handle method signatures with nested arguments.

    Before:

    Assert.assertEquals(displayName, actualRequest.getDisplayName());

    After:

    Assert.assertEquals(displayName, actualRequest.getUser().getDisplayName());
  • Provide a consistent tolerance value of 0.0001 for assertEquals on double and float values.

    Before:

    Assert.assertEquals(expected, actual);

    bazel error: [DoNotCall] This method always throws java.lang.AssertionError. Use assertEquals(expected, actual, delta) to compare floating-point numbers

    After:

    Assert.assertEquals(expected, actual, 0.0001);

@burkedavison burkedavison requested review from a team as code owners November 14, 2022 15:42
@burkedavison burkedavison changed the title Bugfix/support nested argument method signatures fix: Support testing nested argument method signatures and 'double' field assertions Nov 14, 2022
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

76.7% 76.7% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@blakeli0 blakeli0 left a comment

Choose a reason for hiding this comment

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

Ideally for every composer change, we should have a golden unit test updated, like this one. But since we know it will be tested as part of the showcase integration tests, and we are moving away from generated unit tests, this PR is good to merge.

@burkedavison burkedavison merged commit 4bf419f into main Nov 18, 2022
@burkedavison burkedavison deleted the bugfix/support-nested-argument-method-signatures branch November 18, 2022 14:19
suztomo pushed a commit that referenced this pull request Dec 16, 2022
…ield assertions (#1094)

* fix: Support testing nested argument method signatures and 'double' field assertions

* fix: DRY refactor for consistent double+float assertions

* fix: Remove unused parameter.

* fix: Simplify and DRY getter creation

* fix: format
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