@Override
  public Collection<IExternalResourceInfo> getResourcesFromRow( Rest step, RowMetaInterface rowMeta, Object[] row ) {
    Set<IExternalResourceInfo> resources = new HashSet<>();

    RestMeta meta = (RestMeta) step.getStepMetaInterface();
    if ( meta == null ) {
      meta = (RestMeta) step.getStepMeta().getStepMetaInterface();
    }

    if ( meta != null ) {
      String url;
      String method;
      String body;

      try {
        if ( meta.isUrlInField() ) {
          url = rowMeta.getString( row, meta.getUrlField(), null );
        } else {
          url = meta.getUrl();
        }
        if ( StringUtils.isNotEmpty( url ) ) {
          WebServiceResourceInfo resourceInfo = createResourceInfo( url, meta );
          if ( ArrayUtils.isNotEmpty( meta.getHeaderField() ) ) {
            for ( int i = 0; i < meta.getHeaderField().length; i++ ) {
              String field = meta.getHeaderField()[ i ];
              String label = meta.getHeaderName()[ i ];
              resourceInfo.addHeader( label, rowMeta.getString( row, field, null ) );
            }
          }
          if ( ArrayUtils.isNotEmpty( meta.getParameterField() ) ) {
            for ( int i = 0; i < meta.getParameterField().length; i++ ) {
              String field = meta.getParameterField()[ i ];
              String label = meta.getParameterName()[ i ];
              resourceInfo.addParameter( label, rowMeta.getString( row, field, null ) );
            }
          }
          if ( meta.isDynamicMethod() ) {
            method = rowMeta.getString( row, meta.getMethodFieldName(), null );
            resourceInfo.setMethod( method );
          }

          if ( StringUtils.isNotEmpty( meta.getBodyField() ) ) {
            body = rowMeta.getString( row, meta.getBodyField(), null );
            resourceInfo.setBody( body );
          }

          resources.add( resourceInfo );
        }
      } catch ( KettleValueException e ) {
        // could not find a url on this row
        log.debug( e.getMessage(), e );
      }
    }
    return resources;
  }
@Test
  public void testGetResourcesFromRow_fieldsForMethodAndBody() throws Exception {
    when( meta.isUrlInField() ).thenReturn( true );
    when( meta.getUrlField() ).thenReturn( "url" );
    when( meta.getHeaderField() ).thenReturn( null );
    when( meta.getParameterField() ).thenReturn( null );
    when( meta.isDynamicMethod() ).thenReturn( true );
    when( meta.getMethodFieldName() ).thenReturn( "method" );
    when( meta.getBodyField() ).thenReturn( "body" );
    when( rmi.getString( row, "method", null ) ).thenReturn( row[ 2 ].toString() );
    when( rmi.getString( row, "body", null ) ).thenReturn( row[ 2 ].toString() );

    Collection<IExternalResourceInfo> resourcesFromMeta = consumer.getResourcesFromRow( step, rmi, row );

    assertEquals( 1, resourcesFromMeta.size() );
    IExternalResourceInfo resourceInfo = resourcesFromMeta.toArray( new IExternalResourceInfo[ 1 ] )[ 0 ];
    assertEquals( row[ 0 ], resourceInfo.getName() );
    assertNotNull( resourceInfo.getAttributes() );
  }