Changeset 4530 for vlo/branches/vlo-3.0/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/wicket/pages/TestFacetedSearchPage.java
- Timestamp:
- 02/18/14 07:15:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/vlo-3.0/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/wicket/pages/TestFacetedSearchPage.java
r4519 r4530 6 6 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection; 7 7 import eu.clarin.cmdi.vlo.service.FacetFieldsService; 8 import eu.clarin.cmdi.vlo.service.SolrDocumentService; 8 9 import java.util.Arrays; 9 10 import java.util.List; 10 11 import org.apache.solr.client.solrj.response.FacetField; 12 import org.apache.solr.common.SolrDocument; 11 13 import org.apache.wicket.util.tester.WicketTester; 12 14 import org.jmock.Expectations; … … 50 52 } 51 53 54 @Override 55 public SolrDocumentService documentService() { 56 return mockery().mock(SolrDocumentService.class); 57 } 52 58 } 53 59 … … 59 65 @Autowired 60 66 private FacetFieldsService facetFieldsService; 67 @Autowired 68 private SolrDocumentService documentService; 61 69 62 70 @Before … … 70 78 mockery.checking(new Expectations() { 71 79 { 80 // mock facets 72 81 atLeast(1).of(facetFieldsService).getFacetFieldCount(); 73 82 will(returnValue(2L)); 74 83 oneOf(facetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class))); 75 84 will(returnValue(Arrays.asList(new FacetField("language"), new FacetField("resource class")))); 85 86 // mock search results 87 atLeast(1).of(documentService).getDocumentCount(with(any(QueryFacetsSelection.class))); 88 will(returnValue(1000L)); 89 oneOf(documentService).getDocuments(with(any(QueryFacetsSelection.class)), with(equal(0)), with(equal(10))); 90 will(returnValue(Arrays.asList(new SolrDocument(), new SolrDocument()))); 76 91 } 77 92 });
Note: See TracChangeset
for help on using the changeset viewer.