use of org.apereo.portal.events.MockPortletExecutionEvent in project uPortal by Jasig.
the class PortletExecutionEventConverterTest method setupSupportsTest.
private boolean setupSupportsTest(String fname, boolean classMatch, boolean fnameMatch, FNameFilterType filterType) {
PortletExecutionEvent event = spy(new MockPortletExecutionEvent());
when(event.getFname()).thenReturn(fname);
PortletExecutionEventConverter converter = new PortletExecutionEventConverter();
List<Class<? extends PortletExecutionEvent>> classes = new ArrayList<Class<? extends PortletExecutionEvent>>();
classes.add(PortletActionExecutionEvent.class);
if (classMatch) {
classes.add(MockPortletExecutionEvent.class);
}
converter.setSupportedEventTypes(classes);
if (filterType != null) {
List<String> fnames = new ArrayList<String>(2);
fnames.add("_mock-fname");
if (fnameMatch && fname != null) {
fnames.add(fname);
}
converter.setFilterFNames(fnames);
converter.setFnameFilterType(filterType);
}
return converter.supports(event);
}
Aggregations