S3FileObject extends S3CommonFileObject { @Override protected S3Object getS3Object( String key, String bucket ) { if ( s3Object != null && s3Object.getObjectContent() != null ) { logger.debug( "Returning existing object {}", getQualifiedName() ); return s3Object; } else { logger.debug( "Getting object {}", getQualifiedName() ); SimpleEntry<String, String> newPath = fixFilePath( key, bucket ); return fileSystem.getS3Client().getObject( newPath.getValue(), newPath.getKey() ); } } protected  S3FileObject( final AbstractFileName name, final S3FileSystem fileSystem );   }
@Test public void testGetS3Object() throws Exception { when( s3ServiceMock.getObject( anyString(), anyString() ) ).thenReturn( new S3Object() ); S3FileObject s3FileObject = new S3FileObject( filename, fileSystemSpy ); S3Object s3Object = s3FileObject.getS3Object(); assertNotNull( s3Object ); }