### Question:
TableOutputMeta extends BaseTransformMeta implements ITransformMeta<TableOutput, TableOutputData>, IProvidesModelerMeta { public boolean supportsErrorHandling() { if ( databaseMeta != null ) { return databaseMeta.getIDatabase().supportsErrorHandling(); } else { return true; } } TableOutputMeta(); String getGeneratedKeyField(); void setGeneratedKeyField( String generatedKeyField ); boolean isReturningGeneratedKeys(); void setReturningGeneratedKeys( boolean returningGeneratedKeys ); boolean isTableNameInTable(); void setTableNameInTable( boolean tableNameInTable ); String getTableNameField(); void setTableNameField( String tableNameField ); boolean isTableNameInField(); void setTableNameInField( boolean tableNameInField ); boolean isPartitioningDaily(); void setPartitioningDaily( boolean partitioningDaily ); boolean isPartitioningMonthly(); void setPartitioningMonthly( boolean partitioningMontly ); boolean isPartitioningEnabled(); void setPartitioningEnabled( boolean partitioningEnabled ); String getPartitioningField(); void setPartitioningField( String partitioningField ); void allocate( int nrRows ); void loadXml( Node transformNode, IHopMetadataProvider metadataProvider ); Object clone(); DatabaseMeta getDatabaseMeta(); void setDatabaseMeta( DatabaseMeta database ); String getCommitSize(); void setCommitSize( int commitSizeInt ); void setCommitSize( String commitSize ); String getTableName(); void setTableName( String tableName ); @Deprecated String getTablename(); @Deprecated void setTablename( String tablename ); boolean truncateTable(); void setTruncateTable( boolean truncateTable ); void setIgnoreErrors( boolean ignoreErrors ); boolean ignoreErrors(); void setSpecifyFields( boolean specifyFields ); boolean specifyFields(); void setUseBatchUpdate( boolean useBatchUpdate ); boolean useBatchUpdate(); void setDefault(); String getXml(); void getFields( IRowMeta row, String origin, IRowMeta[] info, TransformMeta nextTransform,
                         IVariables variables, IHopMetadataProvider metadataProvider ); void check( List<ICheckResult> remarks, PipelineMeta pipelineMeta, TransformMeta transformMeta,
                     IRowMeta prev, String[] input, String[] output, IRowMeta info, IVariables variables,
                     IHopMetadataProvider metadataProvider ); ITransform createTransform( TransformMeta transformMeta, TableOutputData data, int cnr,
                                     PipelineMeta pipelineMeta, Pipeline pipeline ); TableOutputData getTransformData(); void analyseImpact( List<DatabaseImpact> impact, PipelineMeta pipelineMeta, TransformMeta transformMeta,
                             IRowMeta prev, String[] input, String[] output, IRowMeta info,
                             IHopMetadataProvider metadataProvider ); SqlStatement getSqlStatements( PipelineMeta pipelineMeta, TransformMeta transformMeta, IRowMeta prev,
                                        IHopMetadataProvider metadataProvider ); SqlStatement getSqlStatements( PipelineMeta pipelineMeta, TransformMeta transformMeta, IRowMeta prev, String tk,
                                        boolean use_autoinc, String pk ); IRowMeta getRequiredFields( IVariables variables ); DatabaseMeta[] getUsedDatabaseConnections(); String[] getFieldStream(); void setFieldStream( String[] fieldStream ); @Override RowMeta getRowMeta( ITransformData transformData ); @Override List<String> getDatabaseFields(); @Override List<String> getStreamFields(); String[] getFieldDatabase(); void setFieldDatabase( String[] fieldDatabase ); String getSchemaName(); void setSchemaName( String schemaName ); boolean supportsErrorHandling(); @Override String getMissingDatabaseConnectionInformationMessage();  }### Answer:
@Test public void testSupportsErrorHandling() throws Exception { TableOutputMeta tableOutputMeta = new TableOutputMeta(); DatabaseMeta dbMeta = mock( DatabaseMeta.class ); tableOutputMeta.setDatabaseMeta( dbMeta ); IDatabase iDatabase = mock( IDatabase.class ); when( dbMeta.getIDatabase() ).thenReturn( iDatabase ); when( iDatabase.supportsErrorHandling() ).thenReturn( true, false ); assertTrue( tableOutputMeta.supportsErrorHandling() ); assertFalse( tableOutputMeta.supportsErrorHandling() ); tableOutputMeta.setDatabaseMeta( null ); assertTrue( tableOutputMeta.supportsErrorHandling() ); }