Search in sources :

Example 1 with MockPortletExecutionEvent

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);
}
Also used : MockPortletExecutionEvent(org.apereo.portal.events.MockPortletExecutionEvent) MockPortletExecutionEvent(org.apereo.portal.events.MockPortletExecutionEvent) PortletExecutionEvent(org.apereo.portal.events.PortletExecutionEvent) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 MockPortletExecutionEvent (org.apereo.portal.events.MockPortletExecutionEvent)1 PortletExecutionEvent (org.apereo.portal.events.PortletExecutionEvent)1