@Test public void put_GivenRecords_ShouldWriteToStream() throws IOException { StreamWriter<SampleRecord> writer = new StreamWriter<>(client, streamName, new RecordTranslator()); writer.put(ImmutableList.of(new SampleRecord())); ArgumentCaptor<PutRecordsRequest> arg = ArgumentCaptor.forClass(PutRecordsRequest.class); Mockito.verify(client).putRecords(arg.capture()); Assert.assertEquals(streamName, arg.getValue().streamName()); }
@Override public PutRecordsResponse put(List<T> records) throws IOException { return client.putRecords(PutRecordsRequest.builder() .streamName(streamName) .records(translator.toEntries(records)) .build()); }
StreamWriter implements Writer<T, PutRecordsResponse> { @Override public PutRecordsResponse put(List<T> records) throws IOException { return client.putRecords(PutRecordsRequest.builder() .streamName(streamName) .records(translator.toEntries(records)) .build()); } }
StreamWriter implements Writer<T, PutRecordsResponse> { @Override public PutRecordsResponse put(List<T> records) throws IOException { return client.putRecords(PutRecordsRequest.builder() .streamName(streamName) .records(translator.toEntries(records)) .build()); } StreamWriter(String streamName, AbstractPutRecordsRequestTranslator<T> entryTranslator);  StreamWriter(KinesisClient client, String streamName,
                        AbstractPutRecordsRequestTranslator<T> translator); }
StreamWriter implements Writer<T, PutRecordsResponse> { @Override public PutRecordsResponse put(List<T> records) throws IOException { return client.putRecords(PutRecordsRequest.builder() .streamName(streamName) .records(translator.toEntries(records)) .build()); } StreamWriter(String streamName, AbstractPutRecordsRequestTranslator<T> entryTranslator);  StreamWriter(KinesisClient client, String streamName,
                        AbstractPutRecordsRequestTranslator<T> translator); @Override PutRecordsResponse put(List<T> records); }
StreamWriter implements Writer<T, PutRecordsResponse> { @Override public PutRecordsResponse put(List<T> records) throws IOException { return client.putRecords(PutRecordsRequest.builder() .streamName(streamName) .records(translator.toEntries(records)) .build()); } StreamWriter(String streamName, AbstractPutRecordsRequestTranslator<T> entryTranslator);  StreamWriter(KinesisClient client, String streamName,
                        AbstractPutRecordsRequestTranslator<T> translator); @Override PutRecordsResponse put(List<T> records);  }