Hi this is the full test class code...
package com.informa.wcis.reports.web.components;
import static com.informa.java.util.CollectionUtils.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.stub;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import com.informa.utils.TapestryTestUtils;
import com.informa.wcis.reports.dom.specification.Criterion;
import com.informa.wcis.reports.dom.specification.Level;
import com.informa.wcis.reports.service.ReportService;
@RunWith(JUnit4.class)
public class CriteriaPaletteComponentSpec {
private static final Set<Criterion> CRITERIA = new HashSet<Criterion>
();
private CriteriaPaletteComponent palette;
private ReportService reportService;
@SuppressWarnings("serial")
@Before
public void context() {
reportService = mock(ReportService.class);
Map<String, Object> dependencies = new HashMap<String, Object>(){{put
("reportService", reportService);}};
palette = TapestryTestUtils.createTestableVersionOf
(CriteriaPaletteComponent.class, dependencies);
}
@Test
public void canGetCriterionSelectionModel() {
CriterionSingleSelectionModel model = new
CriterionSingleSelectionModel(asList(CRITERIA));
stub(reportService.getCriteriaFor(Level.NETWORK)).toReturn
(CRITERIA);
palette.setLevels("network");
assertThat(palette.getModel(), equalTo(model));
}
}
On Nov 24, 1:50 pm, szczepiq <
szcze...@gmail.com> wrote:
> Hi,
>
> Please show us the test case where it fails.
>
> Cheers,
> Szczepan Faber
>