### Question:
S3PersistWriter implements StreamsPersistWriter, DatumStatusCountable { @Override public void prepare(Object configurationObject) { lineWriterUtil = LineReadWriteUtil.getInstance(s3WriterConfiguration); synchronized (this) { try { if (this.objectMapper == null) { this.objectMapper = StreamsJacksonMapper.getInstance(); } if (this.amazonS3Client == null) { AWSCredentials credentials = new BasicAWSCredentials(s3WriterConfiguration.getKey(), s3WriterConfiguration.getSecretKey()); ClientConfiguration clientConfig = new ClientConfiguration(); clientConfig.setProtocol(Protocol.valueOf(s3WriterConfiguration.getProtocol().toString())); S3ClientOptions clientOptions = new S3ClientOptions(); clientOptions.setPathStyleAccess(false); this.amazonS3Client = new AmazonS3Client(credentials, clientConfig); if (StringUtils.isNotEmpty(s3WriterConfiguration.getRegion())) { this.amazonS3Client.setRegion(Region.getRegion(Regions.fromName(s3WriterConfiguration.getRegion()))); } this.amazonS3Client.setS3ClientOptions(clientOptions); } } catch (Exception ex) { LOGGER.error("Exception while preparing the S3 client: {}", ex); } Preconditions.checkArgument(this.amazonS3Client != null); } } S3PersistWriter();  S3PersistWriter(S3WriterConfiguration s3WriterConfiguration);  S3PersistWriter(AmazonS3Client amazonS3Client, S3WriterConfiguration s3WriterConfiguration); AmazonS3Client getAmazonS3Client(); S3WriterConfiguration getS3WriterConfiguration(); List<String> getWrittenFiles(); Map<String, String> getObjectMetaData(); ObjectMapper getObjectMapper(); void setObjectMapper(ObjectMapper mapper); void setObjectMetaData(Map<String, String> val); @Override String getId(); @Override void write(StreamsDatum streamsDatum); synchronized OutputStreamWriter resetFile(); @Override void prepare(Object configurationObject); void cleanUp(); @Override DatumStatusCounter getDatumStatusCounter(); static final String STREAMS_ID; }### Answer:
@Test(expected=IllegalArgumentException.class) public void testBadS3Config() { s3PersistWriter = new S3PersistWriter(getBadConfig()); s3PersistWriter.prepare(null); }