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

JBEHAVE-1580 Add ability to convert parameters to particular type #62

Merged
merged 1 commit into from
May 25, 2023

Conversation

uarlouski
Copy link
Member

No description provided.

@uarlouski uarlouski force-pushed the JBEHAVE-1580 branch 2 times, most recently from d9e78e6 to 72a7686 Compare May 25, 2023 11:04
@@ -50,6 +50,11 @@ public <T> T valueAs(String name, Type type) {
return convert(valueFor(name), type);
}

@Override
public <T> T valueAs(Type type) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public <T> T valueAs(Type type) {
public <T> T as(Type type) {

@@ -354,34 +355,44 @@ private static Object applyConverters(Object value, Type basicType, Queue<Parame
(v, c) -> c.convertValue(v, c.getTargetType()), (l, r) -> l);
}

@SuppressWarnings({ "unchecked", "rawtypes" })
public Object convertFromType(Object value, Type target) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public Object convertFromType(Object value, Type target) {
public Object convert(Object value, Type target) {

?

return convertersChain;
}

private void putConverters(Type type, LinkedList<ParameterConverter> container) {
private void putConverters(Type type, LinkedList<ParameterConverter> container,
Function<Type, Boolean> baseTypeChecker) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Function<Type, Boolean> baseTypeChecker) {
Predicate<Type> sourceTypePredicate) {

@uarlouski uarlouski force-pushed the JBEHAVE-1580 branch 4 times, most recently from e408d95 to bca274f Compare May 25, 2023 12:37
@uarlouski uarlouski requested a review from valfirst May 25, 2023 12:38

<script type="syntaxhighlighter" class="brush: java">
<![CDATA[
@Then("the person page is greater than 18: $activityTable")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@Then("the person page is greater than 18: $activityTable")
@Then("the person age is greater than 18: $activityTable")

@sonarcloud
Copy link

sonarcloud bot commented May 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

96.0% 96.0% Coverage
0.0% 0.0% Duplication

@uarlouski uarlouski requested a review from valfirst May 25, 2023 12:59
@uarlouski uarlouski merged commit 2170956 into master May 25, 2023
10 checks passed
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

2 participants