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

CSM-1205 | SuccessFactors Batch Source Plugin - Fix issue related to hierarchical records for Picklist #10

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

sgarg-CS
Copy link
Collaborator

@sgarg-CS sgarg-CS commented Jun 8, 2023

@sgarg-CS sgarg-CS changed the title Bugfix/csm 1205 CSM-1205 | SuccessFactors Batch Source Plugin - Fix issue related to hierarchical records for Picklist Jun 8, 2023
Copy link

@anup-cloudsufi anup-cloudsufi left a 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.

expandFieldList = Arrays.asList(pluginConfig.getExpandOption()
.split(SuccessFactorsUrlContainer.PROPERTY_SEPARATOR));
expandFieldList = Arrays.asList(expandOption.split(SuccessFactorsUrlContainer.PROPERTY_SEPARATOR));
} else if (expandOption.contains("/")) {
Copy link
Collaborator

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

Copy link
Collaborator Author

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));
Copy link
Collaborator

@vikasrathee-cs vikasrathee-cs Jun 8, 2023

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.

Copy link
Collaborator Author

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

@sgarg-CS
Copy link
Collaborator Author

Add some unit tests.

Added unit test case for this use case. 9847880

Copy link

@anup-cloudsufi anup-cloudsufi left a 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 {

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.

Copy link
Collaborator Author

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" +

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed. c20e8b7

@sgarg-CS sgarg-CS merged commit c08abb6 into develop Jul 20, 2023
1 check 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.

3 participants