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

Refactor InputArgumentTest #1084

Merged
merged 1 commit into from
May 31, 2022
Merged

Refactor InputArgumentTest #1084

merged 1 commit into from
May 31, 2022

Conversation

berngp
Copy link
Contributor

@berngp berngp commented May 31, 2022

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Changes in this PR

This commit refactors the InputArgumentTest such that...

  1. We don't have to duplicate setting the Dgs* components in the mocked Application Context. This is now done as BeforeEach step and only overwritten as needed with a set of new methods, which are the withComponents, withDirectives, and withScalars.
  2. The tests don't depend anymore on just asserting the serialized comparison of strings as the output of the data fetcher. They now also assert the expected input arguments in the data fetcher themselves.
  3. Add test cases, skipped for now, that can be used to replicate the Issue 1083.

This commit refactors the InputArgumentTest such that...

1. We don't have to duplicate setting the Dgs* components in the mocked
   Application Context. This is now done as `BeforeEach` step and only
   overwritten as needed with a new method `withComponents`,
   `withDirectives`, or `withScalars`.
2. The tests don't depend anymore on just asserting the serialized
   comparison of strings as the output of the _data fetcher_ but now
   also assert the expected input arguments in the _data fetcher_
   themselves.
3. Add test cases, skipped for now, that can be used to replicate the [Issue 1083].

[Issue 1083]: #1083
@@ -62,196 +48,3 @@ interface InputObjectMapper {
*/
fun <T> mapToJavaObject(inputMap: Map<String, *>, targetClass: Class<T>): T
}

@Suppress("UNCHECKED_CAST")
class DefaultInputObjectMapper(val customInputObjectMapper: InputObjectMapper? = null) : InputObjectMapper {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just moving this to its own file.

@berngp berngp merged commit 3d5ba18 into master May 31, 2022
@berngp berngp deleted the feature/test-input-arguments branch May 31, 2022 21:31
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.

None yet

1 participant