@Test public void getTargetSchemaTest() { when( teraDataBulkLoaderMetaMock.getSchemaName() ).thenReturn( "schemaName" ); when( teraDataBulkLoaderMetaMock.getDbName() ).thenReturn( "dbName" ); assertEquals( "schemaName", teraDataBulkLoaderRoutines.getTargetSchema( true ) ); }
@VisibleForTesting String getTargetSchema( boolean isPreview ) { if ( this.meta.getSchemaName() == null || this.meta.getSchemaName().isEmpty() ) { return isPreview ? this.meta.getDbName() : parent.environmentSubstitute( this.meta.getDbName() ); } return isPreview ? this.meta.getSchemaName() : parent.environmentSubstitute( this.meta.getSchemaName() ); }
TeraDataBulkLoaderRoutines { @VisibleForTesting String getTargetSchema( boolean isPreview ) { if ( this.meta.getSchemaName() == null || this.meta.getSchemaName().isEmpty() ) { return isPreview ? this.meta.getDbName() : parent.environmentSubstitute( this.meta.getDbName() ); } return isPreview ? this.meta.getSchemaName() : parent.environmentSubstitute( this.meta.getSchemaName() ); } }
TeraDataBulkLoaderRoutines { @VisibleForTesting String getTargetSchema( boolean isPreview ) { if ( this.meta.getSchemaName() == null || this.meta.getSchemaName().isEmpty() ) { return isPreview ? this.meta.getDbName() : parent.environmentSubstitute( this.meta.getDbName() ); } return isPreview ? this.meta.getSchemaName() : parent.environmentSubstitute( this.meta.getSchemaName() ); } TeraDataBulkLoaderRoutines( TeraDataBulkLoader parent, TeraDataBulkLoaderMeta meta ); }
TeraDataBulkLoaderRoutines { @VisibleForTesting String getTargetSchema( boolean isPreview ) { if ( this.meta.getSchemaName() == null || this.meta.getSchemaName().isEmpty() ) { return isPreview ? this.meta.getDbName() : parent.environmentSubstitute( this.meta.getDbName() ); } return isPreview ? this.meta.getSchemaName() : parent.environmentSubstitute( this.meta.getSchemaName() ); } TeraDataBulkLoaderRoutines( TeraDataBulkLoader parent, TeraDataBulkLoaderMeta meta ); String dropTable( boolean isPreview, String user, String suffix ); String createScriptFile(); void createFromExistingScriptFile(); String createGeneratedScriptFile(); String createGeneratedScriptFile( Map<String, Integer> inputFieldTypes, Map<String, Integer> inputFieldLength ); }
TeraDataBulkLoaderRoutines { @VisibleForTesting String getTargetSchema( boolean isPreview ) { if ( this.meta.getSchemaName() == null || this.meta.getSchemaName().isEmpty() ) { return isPreview ? this.meta.getDbName() : parent.environmentSubstitute( this.meta.getDbName() ); } return isPreview ? this.meta.getSchemaName() : parent.environmentSubstitute( this.meta.getSchemaName() ); } TeraDataBulkLoaderRoutines( TeraDataBulkLoader parent, TeraDataBulkLoaderMeta meta ); String dropTable( boolean isPreview, String user, String suffix ); String createScriptFile(); void createFromExistingScriptFile(); String createGeneratedScriptFile(); String createGeneratedScriptFile( Map<String, Integer> inputFieldTypes, Map<String, Integer> inputFieldLength );  }