}
@Test
public void should_set_several_callbacks() {
List<Callback> callbacks = new ArrayList<Callback>();
Callback callback = new Callback(CallbackType.CREATEDROW, "aJavascriptFunction");
callbacks.add(callback);
Callback callback2 = new Callback(CallbackType.COOKIE, "anotherJavascriptFunction");
callbacks.add(callback2);
Callback callback3 = new Callback(CallbackType.PREDRAW, "aThirdJavascriptFunction");
callbacks.add(callback3);
table.getTableConfiguration().setCallbacks(callbacks);
Map<String, Object> mainConf = generator.generateConfig(table);
assertThat(mainConf).hasSize(4);
assertThat(mainConf.get(CallbackType.CREATEDROW.getName())).isEqualTo(new JavascriptFunction(callback.getFunction().getCode(), CallbackType.CREATEDROW.getArgs()));
assertThat(mainConf.get(CallbackType.COOKIE.getName())).isEqualTo(new JavascriptFunction(callback2.getFunction().getCode(), CallbackType.COOKIE.getArgs()));
assertThat(mainConf.get(CallbackType.PREDRAW.getName())).isEqualTo(new JavascriptFunction(callback3.getFunction().getCode(), CallbackType.PREDRAW.getArgs()));
}