@Override
  protected Set<StepField> getUsedFields( RestMeta stepMeta ) {
    Set<StepField> usedFields = new HashSet<>();

    // add url field
    if ( stepMeta.isUrlInField() && StringUtils.isNotEmpty( stepMeta.getUrlField() ) ) {
      usedFields.addAll( createStepFields( stepMeta.getUrlField(), getInputs() ) );
    }

    // add method field
    if ( stepMeta.isDynamicMethod() && StringUtils.isNotEmpty( stepMeta.getMethodFieldName() ) ) {
      usedFields.addAll( createStepFields( stepMeta.getMethodFieldName(), getInputs() ) );
    }

    // add body field
    if ( StringUtils.isNotEmpty( stepMeta.getBodyField() ) ) {
      usedFields.addAll( createStepFields( stepMeta.getBodyField(), getInputs() ) );
    }

    // add parameters as used fields
    String[] parameterFields = stepMeta.getParameterField();
    if ( ArrayUtils.isNotEmpty( parameterFields ) ) {
      for ( String paramField : parameterFields ) {
        usedFields.addAll( createStepFields( paramField, getInputs() ) );
      }
    }

    // add headers as used fields
    String[] headerFields = stepMeta.getHeaderField();
    if ( ArrayUtils.isNotEmpty( headerFields ) ) {
      for ( String headerField : headerFields ) {
        usedFields.addAll( createStepFields( headerField, getInputs() ) );
      }
    }

    return usedFields;
  }
@Test
  public void testGetUsedFields_headerField() throws Exception {
    Set<StepField> fields = new HashSet<>();
    when( meta.getHeaderField() ).thenReturn( new String[] { "header1", "header2" } );
    doReturn( stepNodes ).when( analyzer ).getInputs();
    doReturn( fields ).when( analyzer ).createStepFields( anyString(), eq( stepNodes ) );

    Set<StepField> usedFields = analyzer.getUsedFields( meta );

    verify( analyzer ).createStepFields( "header1", stepNodes );
    verify( analyzer ).createStepFields( "header2", stepNodes );
  }