Uploaded image for project: 'Talend Component Kit'
  1. Talend Component Kit
  2. TCOMP-984

Integrate ParameterizedTest with component-runtime-http-junit capture mode

Details

    • Bug
    • Status: Done
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • All
    • Small

    Description

      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

      Attachments

        Activity

          People

            rmannibucau Romain Manni-Bucau
            emmanuel_g emmanuel gallois
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: