When using the testing features Parameterized tests (https://talend.github.io/component-runtime/main/1.0.4/index-testing-components.html#_parameterized_tests) and Capturing mode (https://talend.github.io/component-runtime/main/1.0.4/index-testing-components.html#component-runtime-http-junit).
and with this sample test method:
@ParameterizedTest @ValueSource(strings = { "Opportunity", "OpportunityRole" }) void testDescribeOpportunity(String entity) { inputDataSet.setEntity(MarketoEntity.valueOf(entity)); inputDataSet.setOtherAction(OtherEntityAction.describe); initSource(); while ((result = source.next()) != null) { assertNotNull(result); assertNotNull(result.getString(ATTR_NAME)); assertNotNull(result.getJsonArray(ATTR_DEDUPE_FIELDS)); } }
The framework creates a json named
org.talend.components.marketo.input.OpportunitySourceTest_testDescribeOpportunity.json
The issue is that this file only holds the latest API call and tests fail (1/2).
Ideally, It would be great if we have parameterized test methods to suffix them with the parameter...
ie:
org.talend.components.marketo.input.OpportunitySourceTest_testDescribeOpportunity_Opportunity.json
org.talend.components.marketo.input.OpportunitySourceTest_testDescribeOpportunity_OpportunityRole.json