@@ -205,61 +205,4 @@ public void testInvalidConfigurationThrows() throws Exception {
205205 () -> S3SeekableInputStreamConfiguration .fromConfiguration (connectorConfiguration ));
206206 }
207207
208- /**
209- * This test verifies that the OpenStreamInfo object contains correct encryption
210- * settings when reading an SSEC encrypted file with analytics stream.
211- *
212- * @throws Exception
213- */
214-
215- @ Test
216- public void testAnalyticsStreamOpenStreamInfoWhenSSECEncryptionEnabled () throws Exception {
217- Configuration confSSEC = this .createConfiguration ();
218- S3ATestUtils .disableFilesystemCaching (confSSEC );
219- removeBaseAndBucketOverrides (getTestBucketName (confSSEC ), confSSEC , S3_ENCRYPTION_ALGORITHM , S3_ENCRYPTION_KEY );
220-
221- confSSEC .set (S3_ENCRYPTION_ALGORITHM , S3AEncryptionMethods .SSE_C .getMethod ());
222- confSSEC .set (S3_ENCRYPTION_KEY , SSEC_KEY );
223-
224- S3AContract contractSSEC = (S3AContract ) createContract (confSSEC );
225- contractSSEC .init ();
226- contractSSEC .setConf (confSSEC );
227- S3AFileSystem fileSystemSSEC = (S3AFileSystem ) contractSSEC .getTestFileSystem ();
228-
229- int len = TEST_FILE_LEN ;
230- describe ("Create an encrypted file and verify OpenStreamInfo encryption settings" );
231- Path src = methodPath ();
232- byte [] data = dataset (len , 'a' , 'z' );
233- writeDataset (fileSystemSSEC , src , data , len , 1024 * 1024 , true );
234- // Read with encryption settings
235- OpenStreamInformation originalInfo ;
236- try (FSDataInputStream in = fileSystemSSEC .open (src )) {
237- AnalyticsStream s3AInputStream = (AnalyticsStream ) in .getWrappedStream ();
238- Field inputStreamField = s3AInputStream .getClass ().getDeclaredField ("inputStream" );
239- inputStreamField .setAccessible (true );
240- S3SeekableInputStream seekableInputStream = (S3SeekableInputStream ) inputStreamField .get (s3AInputStream );
241-
242- Field logicalIOField = seekableInputStream .getClass ().getDeclaredField ("logicalIO" );
243- logicalIOField .setAccessible (true );
244- Object logicalIO = logicalIOField .get (seekableInputStream );
245-
246- Field physicalIOField = logicalIO .getClass ().getDeclaredField ("physicalIO" );
247- physicalIOField .setAccessible (true );
248- Object physicalIO = physicalIOField .get (logicalIO );
249-
250- Field openStreamInfoField = physicalIO .getClass ().getDeclaredField ("openStreamInformation" );
251- openStreamInfoField .setAccessible (true );
252- originalInfo = (OpenStreamInformation ) openStreamInfoField .get (physicalIO );
253-
254- // Verify the OpenStreamInfo object exists
255- assertNotNull (originalInfo .getEncryptionSecrets ().getSsecCustomerKey ().get (), "OpenStreamInfo should not be null" );
256- assertEquals (SSEC_KEY , originalInfo .getEncryptionSecrets ().getSsecCustomerKey ().get ());
257- }
258-
259- // Clean up
260- fileSystemSSEC .delete (src , false );
261- }
262-
263-
264-
265208}
0 commit comments