-
Notifications
You must be signed in to change notification settings - Fork 0
Os VT 2 - Providers implemented #3
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
base: master
Are you sure you want to change the base?
Conversation
| @@ -0,0 +1,31 @@ | |||
| package io.opensaber.provider; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this into another package altogether and call it as an example. Say, src/main/java/org/example/provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| result.put(field.getTitle(), evaluator.evaluate().toString()); | ||
|
|
||
| Object evaluatedValue = evaluator.evaluate(); | ||
| if(evaluatedValue instanceof String){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test that JsonNodeFactory.instance.pojoNode(evaluatedValue)); will not work for String? Asking if we should really have if-else here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have tested this, does not work for String. Hence I preferred a check.
src/test/resources/personVT1.json
Outdated
| { | ||
| "title": "Name in passport", | ||
| "function": "#/functionDefinitions/concat($lastName, $firstName)", | ||
| "function": "#/functionDefinitions/userDefinedConcat($lastName, $firstName)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a sample with both in-line and provider and ref for test purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Part 2 changes done-
Introduced IEvaluator: public T evaluate() and EvaluatorFactory: getInstance()
Impl classes added :- ProviderEvaluator and FunctionEvaluator
Added impl class SampleViewFunctionProvider (IViewFunctionProvider)
SampleViewFunctionProvider : doAction() called by ProviderEvaluator:evaluate()
Note: No impl for reference is present