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

[plugin-rest-api] Introduce variableName parameter for FROM_JSON transformer #3718

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

EDbarvinsky
Copy link
Contributor

Closes #3642

@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Merging #3718 (8065ea3) into master (9533ca8) will decrease coverage by 7.53%.
The diff coverage is 100.00%.

❗ Current head 8065ea3 differs from pull request most recent head 70d2cdd. Consider uploading reports for the commit 70d2cdd to get more accurate results

@@             Coverage Diff              @@
##             master    #3718      +/-   ##
============================================
- Coverage     96.97%   89.45%   -7.53%     
- Complexity     6341     6348       +7     
============================================
  Files           862      862              
  Lines         17513    17521       +8     
  Branches       1145     1150       +5     
============================================
- Hits          16984    15673    -1311     
- Misses          422     1720    +1298     
- Partials        107      128      +21     
Impacted Files Coverage Δ
.../http/transformer/JsonRestApiTableTransformer.java 89.28% <100.00%> (+4.28%) ⬆️

... and 69 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Comment on lines 90 to 91
assertThat(logger.getLoggingEvents(), is(List.of(getDeprecatedEvent(URL_PROPERTY, VARIABLE_NAME_PROPERTY)
)));
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to reformat these lines of code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced with pure jupiter asseertions

{
when(variableContext.getVariable(VAR_NAME)).thenReturn(JSON_DATA);
testTransform(parameter + VAR_NAME);
assertThat(logger.getLoggingEvents(), expectedLogEvent);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assertThat(logger.getLoggingEvents(), expectedLogEvent);
assertThat(logger.getLoggingEvents(), is(expectedLogEvent));

and remove is from test arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with pure jupiter assertions

@EDbarvinsky EDbarvinsky requested review from valfirst and removed request for ikalinin1 and uarlouski March 16, 2023 09:01
private static final String VARIABLE_PROPERTY = "variable";
private static final String VARIABLE_NAME_PROPERTY = "variableName";
Copy link
Member

Choose a reason for hiding this comment

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

no docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

proper warning is added into docs on the same way as for url

@@ -58,9 +62,23 @@ public String transform(String tableAsString, TableParsers tableParsers, TablePr

String columns = properties.getMandatoryNonBlankProperty("columns", String.class);

boolean deprecatedNamePropertyPresent = properties.getProperties().getProperty(VARIABLE_PROPERTY) != null;
Copy link
Member

Choose a reason for hiding this comment

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

java.util.Properties#containsKey ?

Copy link
Collaborator

@valfirst valfirst left a comment

Choose a reason for hiding this comment

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

docs are lost now

@valfirst valfirst merged commit 0304b42 into vividus-framework:master Mar 17, 2023
@EDbarvinsky EDbarvinsky deleted the 3642 branch March 18, 2023 13:04
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.

Rename parameter variable to variableName for FROM_JSON transformer
4 participants