-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Java] Allow parameter types access to test context #1677
Merged
mpkorstanje
merged 30 commits into
develop-v5
from
allow-parameter-types-access-to-test-context
Jul 28, 2019
Merged
[Java] Allow parameter types access to test context #1677
mpkorstanje
merged 30 commits into
develop-v5
from
allow-parameter-types-access-to-test-context
Jul 28, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mpkorstanje
force-pushed
the
allow-parameter-types-access-to-test-context
branch
2 times, most recently
from
July 12, 2019 21:03
cc1c541
to
6b3b763
Compare
mpkorstanje
force-pushed
the
allow-parameter-types-access-to-test-context
branch
3 times, most recently
from
July 21, 2019 17:47
99cadd0
to
9475dc9
Compare
mpkorstanje
force-pushed
the
allow-parameter-types-access-to-test-context
branch
from
July 21, 2019 17:48
9475dc9
to
bfef3a6
Compare
mpkorstanje
force-pushed
the
allow-parameter-types-access-to-test-context
branch
from
July 22, 2019 07:16
c144e7e
to
ec3563c
Compare
A few projects are missing Automatic-Module-Name in the Manifest.mf file.
mpkorstanje
changed the title
WIP Allow parameter types access to test context
[Java] Allow parameter types access to test context
Jul 28, 2019
mpkorstanje
pushed a commit
that referenced
this pull request
Oct 9, 2019
Implements a Java8 equivalent for #1677.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
By annotating methods parameter and data table types can be defined as part of the Glue. This enables them to access the test context and makes them eligible for dependency injection. Additionally the type registry is now created for each feature. This means the language of the feature will be used to convert numbers.
Details
Parameter and DataTable Type
Introduces the
@ParameterType
and@DataTableType
annotations. This allows parameter and datatable types to be mapped to objects which can only be created by services inside the test context.For example in this scenario
We are now able to look up the "awestruck eels" in the "awesome" catalog.
Default Transformer
It is now also possible to register default transformers using annotations. Default transformers allow you to specific a transformer that will be used when there is no transform defined. This can
be combined with an object mapper like Jackson to quickly transform well known string representations to Java objects.
@DefaultParameterTransformer
@DefaultDataTableEntryTransformer
@DefaultDataTableCellTransformer
Localization
Some languages uses comma's rather then points to separate decimals. Previously to parse these properly you'd have to use
TypeRegistryConfigurer.locale
to set this globally. When not explicitly provided Cucumber will now take the language from the feature file. This makes the following work without additional configuration:Motivation & Context
Fixes #851.
Fixes #1458.
Types of changes
Checklist: