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

cucumber-expressions: Prefer Java type hint over parameter type #659

Merged
merged 5 commits into from
Aug 11, 2019

Commits on Aug 2, 2019

  1. cucumber-expressions: Prefer Java type hint over parameter type

    When there is a conflict between the type hint from the regular expression
    and the method prefer the the parameter type associated with the regular
    expression. This ensures we will use the internal/user registered parameter
    transformer rather then the default.
    
    Unless the parameter type indicates it is the stronger type hint.
    
    Reasoning:
    1. Pure cucumber expression users will not notice this in either scenario.
    2. Pure regular expression users will benefit because
       `BuiltInParameterTransformer` can now seamlessly transform any captured
       values. (For all built in types useRegexpMatchAsStrongTypeHint is
       explicitly set to false.)
    2. Regular expression users that define a default transformer have little
       need to define parameter types. The default transformer should be
       sufficiently powerful to meet their needs and will often allow users to
       add custom creation methods e.g. Jacksons @JsonFactory.
    3. Users who mix regular and cucumber expressions may run into conflicts
       when a registered cucumber expression and unregistered happens to
       collide. However this was the situation before this flag was added.
    4. Regular expression users who define custom parameter types do so with
       the expectation that the parameter will be matched. Subverting this
       expectation when the method signature does not match may result in a
       parameter transformer that is unable to convert to the desired type.
       Leaving the user puzzled as to why his transform was ignored.
    
    Fixes: #658
    mpkorstanje committed Aug 2, 2019
    Configuration menu
    Copy the full SHA
    f90958d View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2019

  1. cucumber-expressions: Prefer Go type hint over parameter type

    When there is a conflict between the type hint from the regular expression
    and the method prefer the the parameter type associated with the regular
    expression. This ensures we will use the internal/user registered parameter
    transformer rather then the default.
    
    Unless the parameter type indicates it is the stronger type hint.
    
    Reasoning:
    1. Pure cucumber expression users will not notice this in either scenario.
    2. Pure regular expression users will benefit because
       `BuiltInParameterTransformer` can now seamlessly transform any captured
       values. (For all built in types `useRegexpMatchAsStrongTypeHint` is
       explicitly set to false.)
    2. Regular expression users that define a default transformer have little
       need to define parameter types. The default transformer should be
       sufficiently powerful to meet their needs and will often allow users to
       add custom creation methods e.g. Jacksons @JsonFactory.
    3. Users who mix regular and cucumber expressions may run into conflicts
       when a registered cucumber expression and unregistered happens to
       collide. However this was the situation before this flag was added.
    4. Regular expression users who define custom parameter types do so with
       the expectation that the parameter will be matched. Subverting this
       expectation when the method signature does not match may result in a
       parameter transformer that is unable to convert to the desired type.
       Leaving the user puzzled as to why his transform was ignored.
    mpkorstanje committed Aug 4, 2019
    Configuration menu
    Copy the full SHA
    cf62394 View commit details
    Browse the repository at this point in the history
  2. Update changelog

    mpkorstanje committed Aug 4, 2019
    Configuration menu
    Copy the full SHA
    0389bf1 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2019

  1. Configuration menu
    Copy the full SHA
    69ce125 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2019

  1. Configuration menu
    Copy the full SHA
    8094db4 View commit details
    Browse the repository at this point in the history