void truncateTable() throws KettleDatabaseException {
    if ( !meta.isPartitioningEnabled() && !meta.isTableNameInField() ) {
      // Only the first one truncates in a non-partitioned step copy
      //
      if ( meta.truncateTable()
        && ( ( getCopy() == 0 && getUniqueStepNrAcrossSlaves() == 0 ) || !Utils.isEmpty( getPartitionID() ) ) ) {
        data.db.truncateTable( environmentSubstitute( meta.getSchemaName() ), environmentSubstitute( meta
          .getTableName() ) );

      }
    }
  }
@Test
  public void testTruncateTable_on_PartitionId() throws Exception {
    when( tableOutputMeta.truncateTable() ).thenReturn( true );
    when( tableOutputSpy.getCopy() ).thenReturn( 1 );
    when( tableOutputSpy.getUniqueStepNrAcrossSlaves() ).thenReturn( 0 );
    when( tableOutputSpy.getPartitionID() ).thenReturn( "partition id" );
    when( tableOutputMeta.getTableName() ).thenReturn( "fooTable" );
    when( tableOutputMeta.getSchemaName() ).thenReturn( "barSchema" );

    tableOutputSpy.truncateTable();
    verify( db ).truncateTable( any(), any() );
  }