use of com.artezio.arttime.web.FilterBean in project ART-TIME by Artezio.
the class ReportedHoursIndicatorTest method testGetFilter.
@Test
public void testGetFilter() {
hoursIndicator = new ReportedHoursIndicator();
FacesContext facesContext = createMock(FacesContext.class);
Application application = createMock(Application.class);
FilterBean filterBean = createMock(FilterBean.class);
Filter filter = new Filter();
PowerMock.mockStatic(FacesContext.class);
expect(FacesContext.getCurrentInstance()).andReturn(facesContext);
expect(facesContext.getApplication()).andReturn(application);
expect(application.evaluateExpressionGet(facesContext, "#{filterBean}", Object.class)).andReturn(filterBean);
expect(filterBean.getCurrentFilter()).andReturn(filter);
PowerMock.replayAll(FacesContext.class, facesContext, application, filterBean);
Filter actual = hoursIndicator.getFilter();
PowerMock.verifyAll();
assertSame(filter, actual);
}
Aggregations