### Question:
SynchronizeAfterMerge extends BaseTransform<SynchronizeAfterMergeMeta, SynchronizeAfterMergeData> implements ITransform<SynchronizeAfterMergeMeta, SynchronizeAfterMergeData> { public boolean init() { if ( super.init() ) { try { meta.normalizeAllocationFields(); data.realSchemaName = environmentSubstitute( meta.getSchemaName() ); if ( meta.istablenameInField() ) { if ( Utils.isEmpty( meta.gettablenameField() ) ) { logError( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Log.Error.TableFieldnameEmpty" ) ); return false; } } data.databaseMeta = meta.getDatabaseMeta(); if ( data.databaseMeta.getIDatabase().isOracleVariant() ) { data.releaseSavepoint = false; } data.commitSize = Integer.parseInt( environmentSubstitute( meta.getCommitSize() ) ); data.batchMode = data.commitSize > 0 && meta.useBatchUpdate(); data.specialErrorHandling = getTransformMeta().isDoingErrorHandling() && meta.getDatabaseMeta().supportsErrorHandlingOnBatchUpdates(); data.supportsSavepoints = meta.getDatabaseMeta().getIDatabase().useSafePoints(); if ( data.batchMode && data.specialErrorHandling ) { data.batchMode = false; if ( log.isBasic() ) { logBasic( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Log.BatchModeDisabled" ) ); } } if ( meta.getDatabaseMeta() == null ) { logError( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Init.ConnectionMissing", getTransformName() ) ); return false; } data.db = new Database( this, meta.getDatabaseMeta() ); data.db.shareVariablesWith( this ); data.db.connect( getPartitionId() ); data.db.setCommit( data.commitSize ); return true; } catch ( HopException ke ) { logError( BaseMessages.getString( PKG, "SynchronizeAfterMerge.Log.ErrorOccurredDuringTransformInitialize" ) + ke .getMessage() ); } } return false; } SynchronizeAfterMerge( TransformMeta transformMeta, SynchronizeAfterMergeMeta meta, SynchronizeAfterMergeData data, int copyNr, PipelineMeta pipelineMeta,
                                Pipeline pipeline ); String getLookupStatement( IRowMeta rowMeta ); String getUpdateStatement( IRowMeta rowMeta ); String getDeleteStatement( IRowMeta rowMeta ); boolean processRow(); boolean init();  }### Answer:
@Ignore @Test public void initWithCommitSizeVariable() { TransformMeta transformMeta = mock( TransformMeta.class ); doReturn( TRANSFORM_NAME ).when( transformMeta ).getName(); doReturn( 1 ).when( transformMeta ).getCopies(); SynchronizeAfterMergeMeta smi = mock( SynchronizeAfterMergeMeta.class ); SynchronizeAfterMergeData sdi = mock( SynchronizeAfterMergeData.class ); DatabaseMeta dbMeta = mock( DatabaseMeta.class ); doReturn( mock( GenericDatabaseMeta.class ) ).when( dbMeta ).getIDatabase(); doReturn( dbMeta ).when( smi ).getDatabaseMeta(); doReturn( "${commit.size}" ).when( smi ).getCommitSize(); PipelineMeta pipelineMeta = mock( PipelineMeta.class ); doReturn( transformMeta ).when( pipelineMeta ).findTransform( TRANSFORM_NAME ); SynchronizeAfterMerge transform = mock( SynchronizeAfterMerge.class ); doCallRealMethod().when( transform ).setPipelineMeta( any( PipelineMeta.class ) ); doCallRealMethod().when( transform ).setTransformMeta( any( TransformMeta.class ) ); doCallRealMethod().when( transform ).init(); doReturn( transformMeta ).when( transform ).getTransformMeta(); doReturn( pipelineMeta ).when( transform ).getPipelineMeta(); doReturn( "120" ).when( transform ).environmentSubstitute( "${commit.size}" ); transform.setPipelineMeta( pipelineMeta ); transform.setTransformMeta( transformMeta ); transform.init(); assertEquals( 120, sdi.commitSize ); }