@Test public void put_GivenRecords_ShouldTranslateEachToPutRecordsRequestEntry() throws IOException { RecordTranslator translatorSpy = Mockito.spy(new RecordTranslator()); StreamWriter<SampleRecord> writer = new StreamWriter<>(client, streamName, translatorSpy); List<SampleRecord> records = ImmutableList.of(new SampleRecord()); writer.put(records); Mockito.verify(translatorSpy).toEntries(records); }
@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);  }