BootstrapDatePicker extends WebMarkupContainer implements IGenericComponent<Date, TextField<Date>> { public Collection<SpecialDate> getSpecialDates() { return null; } BootstrapDatePicker(String id); DateTextField getDateTextField(); Collection<SpecialDate> getSpecialDates(); @Override IModel<Date> getModel(); @Override TextField<Date> setModel(IModel<Date> model); @Override Date getModelObject(); @Override TextField<Date> setModelObject(Date object);  }
@Test public void testDatepickerInvokeSpecialDates() { final List<SpecialDate> list = Arrays.asList(new SpecialDate(christmas, "holiday", "Christmas")); BootstrapDatePicker picker = new BootstrapDatePicker("picker") { private static final long serialVersionUID = 1L; @Override public Collection<SpecialDate> getSpecialDates() { return list; } }; List<? extends Behavior> behaviors = picker.getBehaviors(); assertEquals(1, behaviors.size()); assertTrue(behaviors.get(0) instanceof BootstrapDatePickerBehaviour); assertEquals(list, ((BootstrapDatePickerBehaviour)behaviors.get(0)).getSpecialDates()); }