@Test public void shoud_load_the_extension_with_the_given_ajax_source() { extensionProcessor.process(new HashSet<Extension>(Arrays.asList(new PipeliningFeature()))); assertThat(AssetRequestContext.get(table.getTableConfiguration().getRequest()).getBundles(true)) .hasSize(1); assertThat(mainConfig) .includes( entry(DTConstants.DT_FN_SERVERDATA, new JavascriptSnippet("fnDataTablesPipeline"))); // TODO test the pipe size }
@Test public void shoud_load_the_extension_with_the_given_ajax_source() { TableConfig.AJAX_SOURCE.setIn(table.getTableConfiguration(), "/ajaxSource"); extensionProcessor.process(new HashSet<Extension>(Arrays.asList(new AjaxFeature()))); assertThat(AssetRequestContext.get(table.getTableConfiguration().getRequest()).getBundles(true)) .hasSize(0); assertThat(mainConfig) .includes( entry(DTConstants.DT_B_DEFER_RENDER, true), entry(DTConstants.DT_S_AJAXDATAPROP, ""), entry(DTConstants.DT_S_AJAX_SOURCE, "/ajaxSource")); assertThat(mainConfig.get(CallbackType.INIT.getName()).toString()) .isEqualTo( new JavascriptFunction( "oTable_fakeId.fnAdjustColumnSizing(true);", CallbackType.INIT.getArgs()) .toString()); }