S3FileOutput extends TextFileOutput { @Override public boolean init( StepMetaInterface smi, StepDataInterface sdi ) { init( smi ); return super.init( smi, sdi ); } S3FileOutput( StepMeta stepMeta, StepDataInterface stepDataInterface, int copyNr, TransMeta transMeta,
      Trans trans ); @Override boolean init( StepMetaInterface smi, StepDataInterface sdi ); @Override void markStop();  }
@Test public void initWithDefaultCredentialsTest() { System.setProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS, "Y" ); s3FileOutput.init( smi ); Assert.assertEquals( "", System.getProperty( "aws.accessKeyId" ) ); Assert.assertEquals( "", System.getProperty( "aws.secretKey" ) ); }
@Test public void initWithNoCredentialsTest() { System.setProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS, "N" ); when( smi.getAccessKey() ).thenReturn( "" ); when( smi.getSecretKey() ).thenReturn( "" ); s3FileOutput.init( smi ); Assert.assertEquals( "", System.getProperty( "aws.accessKeyId" ) ); Assert.assertEquals( "", System.getProperty( "aws.secretKey" ) ); }
@Test public void initWithCredentialsTest() { System.setProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS, "N" ); when( smi.getAccessKey() ).thenReturn( "accessKey" ); when( smi.getSecretKey() ).thenReturn( "secretKey" ); s3FileOutput.init( smi ); Assert.assertEquals( "accessKey", System.getProperty( "aws.accessKeyId" ) ); Assert.assertEquals( "secretKey", System.getProperty( "aws.secretKey" ) ); }
@Test public void initWithCredentialsEncryptedTest() { System.setProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS, "N" ); when( smi.getAccessKey() ).thenReturn( "Encrypted 2be98afc86aa7f285a81aab63cdb9aac3" ); when( smi.getSecretKey() ).thenReturn( "Encrypted 2be98afc86aa7f297ae1abc75cab9aac3" ); s3FileOutput.init( smi ); Assert.assertEquals( "accessKey", System.getProperty( "aws.accessKeyId" ) ); Assert.assertEquals( "secretKey", System.getProperty( "aws.secretKey" ) ); }