### Question:
S3FileStore implements InternetFileStore { @Override public void write(final FilePath filePath, final FileItem fileItem) { writeFileItem(filePath, fileItem, fileItem.filename()); } S3FileStore(final String bucketSchema); void initialize(final AmazonS3 amazonS3Client); @Override FileItem read(final FilePath filePath); @Override void write(final FilePath filePath, final FileItem fileItem); @Override void write(final FilePath filePath, final FileItem fileItem, final String filename); @Override void delete(final FilePath filePath); @Override URL publicUrlForFilePath(final FilePath filePath); @Override List<FilePath> list(final String directory, final String prefix);  }### Answer:
@Test public void shouldNotWrite_whenNotInitialized() { final S3FileStore s3FileStore = new S3FileStore(bucketSchema); IllegalStateException actualException = null; try { s3FileStore.write(filePath, mockFileItem); } catch (final IllegalStateException e) { actualException = e; } assertNotNull(actualException); }
@Test public void shouldNotWrite_whenFilenameNotInitialized() { final S3FileStore s3FileStore = new S3FileStore(bucketSchema); final String filename = randomString(); IllegalStateException actualException = null; try { s3FileStore.write(filePath, mockFileItem, filename); } catch (final IllegalStateException e) { actualException = e; } assertNotNull(actualException); }