AwsS3Ingester implements Ingester { @Override public void ingest(String tag, ByteBuffer dataBuffer) throws IOException { S3DestinationDecider.S3Destination s3Destination = s3DestinationDecider.decide(tag, Instant.now()); String bucket = s3Destination.getBucket(); String key = s3Destination.getKey(); sender.send(bucket, key, dataBuffer); } AwsS3Ingester(AwsS3Sender sender, S3DestinationDecider s3DestinationDecider); @Override void ingest(String tag, ByteBuffer dataBuffer); @Override Sender getSender(); S3DestinationDecider getS3DestinationDecider(); @Override void close();  }
@Test void ingest() throws IOException { ingester.ingest("foo.bar", ByteBuffer.wrap("hello, world".getBytes(StandardCharsets.UTF_8))); verify(s3Sender, times(1)) .send(eq("mybucket"), eq("my/key/base.data"), eq(ByteBuffer.wrap("hello, world".getBytes(StandardCharsets.UTF_8)))); }