You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background
Currently, we initalize Knot.x instance from provided configuration only when an appropriate variable type is present in a given class, or on a given method. As a result, tests that need to interact with Knot.x indirectly will have some unneeded code inside - for example we need to test a service that interacts with Knot.x, but we don't need to extend it in any way, yet we will still need to declare Vert.x variables and contexts.
Expected behavior
There should be a way to force initalization of Knot.x instance without the need to declare all variables (Vert.x instance and test context). This can be potentially done in two ways:
Add an explicit flag/annotation that will force initialization of Knot.x when there are no method/class variables present;
Detect following: presence of @KnotxApplyConfiguration on method/class and lack of Vert.x variables in method/class, and then initalize Knot.x instance.
Also:
We should stop requiring user to put both Vert.x and test context in order to use configuration injection.
If user doesn't explicitly need to fail the test that uses Knot.x, assume that the run was successful and act accordingly.
It should be possible to implement this in an orderly fashion by using JUnit's store mechanism.
Provide some examples for implemented solution, and extend the documentation to reflect the changes.
Things to keep in mind
Backward compatibility; all changes must be transparent to existing functionalities, and opt-in in nature. If we decide to break compatibility, there should be some additional checks put in place to warn user of the changed behavior.
Explore the possibility to backport these changes into previous versions (specifically, into v1.5, as some projects still use this version).
The text was updated successfully, but these errors were encountered:
tMaxx
changed the title
Support intialization of Knot.x w/o variable in method/class signature
Intialization of Knot.x w/o variable in method/class signature
May 12, 2020
Background
Currently, we initalize Knot.x instance from provided configuration only when an appropriate variable type is present in a given class, or on a given method. As a result, tests that need to interact with Knot.x indirectly will have some unneeded code inside - for example we need to test a service that interacts with Knot.x, but we don't need to extend it in any way, yet we will still need to declare Vert.x variables and contexts.
Expected behavior
There should be a way to force initalization of Knot.x instance without the need to declare all variables (Vert.x instance and test context). This can be potentially done in two ways:
@KnotxApplyConfiguration
on method/class and lack of Vert.x variables in method/class, and then initalize Knot.x instance.Also:
Things to keep in mind
The text was updated successfully, but these errors were encountered: