private void testEncryptsAndDecryptsMessage(Map<String, Object> topoConf) {
String testText = "Tetraodontidae is a family of primarily marine and estuarine fish of the order" +
" Tetraodontiformes. The family includes many familiar species, which are" +
" variously called pufferfish, puffers, balloonfish, blowfish, bubblefish," +
" globefish, swellfish, toadfish, toadies, honey toads, sugar toads, and sea" +
" squab.[1] They are morphologically similar to the closely related" +
" porcupinefish, which have large external spines (unlike the thinner, hidden" +
" spines of Tetraodontidae, which are only visible when the fish has puffed up)." +
" The scientific name refers to the four large teeth, fused into an upper and" +
" lower plate, which are used for crushing the shells of crustaceans and" +
" mollusks, their natural prey.";
Kryo kryo = new Kryo();
BlowfishTupleSerializer writerBTS = new BlowfishTupleSerializer(kryo, topoConf);
BlowfishTupleSerializer readerBTS = new BlowfishTupleSerializer(kryo, topoConf);
int bufferSize = 1024;
Output output = new Output(bufferSize, bufferSize);
Input input = new Input(bufferSize);
String[] stringList = testText.split(" ");
ListDelegate delegate = new ListDelegate();
delegate.addAll(Arrays.asList(stringList));
writerBTS.write(kryo, output, delegate);
input.setBuffer(output.getBuffer());
ListDelegate outDelegate = readerBTS.read(kryo, input, ListDelegate.class);
Assert.assertEquals(testText, Joiner.on(" ").join(outDelegate.toArray()));
}
}