-
Notifications
You must be signed in to change notification settings - Fork 0
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
CSM-1205 | SuccessFactors Batch Source Plugin - Fix issue related to hierarchical records for Picklist #10
Conversation
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.
Add some unit tests.
src/main/java/io/cdap/plugin/successfactors/source/transport/SuccessFactorsUrlContainer.java
Outdated
Show resolved
Hide resolved
src/main/java/io/cdap/plugin/successfactors/source/transport/SuccessFactorsUrlContainer.java
Outdated
Show resolved
Hide resolved
expandFieldList = Arrays.asList(pluginConfig.getExpandOption() | ||
.split(SuccessFactorsUrlContainer.PROPERTY_SEPARATOR)); | ||
expandFieldList = Arrays.asList(expandOption.split(SuccessFactorsUrlContainer.PROPERTY_SEPARATOR)); | ||
} else if (expandOption.contains("/")) { |
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.
use NAV_PROPERTY_SEPARATOR 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.
Replaced "/"
with NAV_PROPERTY_SEPARATOR
5ba462f
expandFieldList = Arrays.asList(expandOption.split(SuccessFactorsUrlContainer.PROPERTY_SEPARATOR)); | ||
} else if (expandOption.contains("/")) { | ||
expandFieldList.add(Arrays.asList(expandOption.split(SuccessFactorsUrlContainer.NAV_PROPERTY_SEPARATOR)) | ||
.get(0)); |
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.
why are we adding only first element? And if only one is required don't use Arrays.asList, use[0] instead.
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.
This is for handling the expand Option input, where two or more levels of nesting exist in the entity data such as picklistOptions/picklistLabels
We only need the first child as it is sufficient to bring all its grandchildren
Replaced Arrays.asList with [0] 5ba462f
Added unit test case for this use case. 9847880 |
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.
Looks good, minor refactoring.
} | ||
|
||
@Test | ||
public void runPipelineWithDefaultValues() throws Exception { |
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.
add a meaningful name for this test.
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.
Renamed the test method. c20e8b7
String schemaString = "{\n" + | ||
" \"type\": \"record\",\n" + | ||
" \"name\": \"SuccessFactorsColumnMetadata\",\n" + | ||
" \"fields\": [\n" + |
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.
Minor: remove the \n
from the 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.
removed. c20e8b7
571e984
to
e35c39e
Compare
CSM-1205