integration-tests/src/test/java/com/kdgregory/aws/utils/KinesisIntegrationTest.java
/**
     *  Asserts that a batch of messages contains the expected text values and expected
     *  number of partition keys (represented as a range to account for possible
     *  duplication of random keys).
     */
Asserts that a batch of messages contains the expected text values and expected
number of partition keys (represented as a range to account for possible
duplication of random keys).
Asserts that a batch of messages contains the expected text values and expected number of partition keys ( represented as a range to account for possible duplication of random keys ) .
private void assertRecords(
        String baseMessage, List<Record> records,
        int expectedRecordCount, int expectedMinPartitionKeys, int expectedMaxPartitionKeys,
        Set<String> expectedMessages)
    throws Exception
    {
        assertEquals(baseMessage + ": record count", expectedRecordCount, records.size());
        Set<String> partitionKeys = new HashSet<String>();
        Set<String> messages = new HashSet<String>();
        for (Record record : records)
        {
            partitionKeys.add(record.getPartitionKey());
            messages.add(new String(BinaryUtils.copyBytesFrom(record.getData()), "UTF-8"));
        }
        NumericAsserts.assertInRange(baseMessage + ": number of distinct partition keys",
                                     expectedMinPartitionKeys, expectedMaxPartitionKeys,
                                     partitionKeys.size());
        assertEquals(baseMessage + ": message contents", expectedMessages, messages);
    }
private void assertRecords ( String baseMessage , List < Record > records , int expectedRecordCount , int expectedMinPartitionKeys , int expectedMaxPartitionKeys , Set < String > expectedMessages ) throws Exception { assertEquals ( baseMessage + ": record count" , expectedRecordCount , records . size ( ) ) ; Set < String > partitionKeys = new HashSet < String > ( ) ; Set < String > messages = new HashSet < String > ( ) ; for ( Record record : records ) { partitionKeys . add ( record . getPartitionKey ( ) ) ; messages . add ( new String ( BinaryUtils . copyBytesFrom ( record . getData ( ) ) , "UTF-8" ) ) ; } NumericAsserts . assertInRange ( baseMessage + ": number of distinct partition keys" , expectedMinPartitionKeys , expectedMaxPartitionKeys , partitionKeys . size ( ) ) ; assertEquals ( baseMessage + ": message contents" , expectedMessages , messages ) ; }
Asserts that a batch of messages contains the expected text values and expected
  number of partition keys (represented as a range to account for possible
  duplication of random keys).
Asserts that a batch of messages contains the expected text values and expected number of partition keys ( represented as a range to account for possible duplication of random keys ) .