Changeset 4579 for vlo/branches/vlo-3.0/vlo-web-app/src/test/java/eu/clarin/cmdi/vlo/wicket/pages/TestFacetedSearchPage.java
- Timestamp:
- 02/25/14 16:33:17 (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
r4530 r4579 3 3 import eu.clarin.cmdi.vlo.wicket.pages.FacetedSearchPage; 4 4 import eu.clarin.cmdi.vlo.VloWicketApplication; 5 import eu.clarin.cmdi.vlo.config.VloConfig; 5 6 import eu.clarin.cmdi.vlo.config.VloSpringConfig; 6 7 import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection; … … 27 28 28 29 import static org.hamcrest.core.AnyOf.*; 30 import org.springframework.beans.factory.annotation.Qualifier; 29 31 30 32 /** … … 48 50 49 51 @Override 52 @Bean(name = VloSpringConfig.FACETS_PANEL_SERVICE) 50 53 public FacetFieldsService facetFieldsService() { 51 return mockery().mock(FacetFieldsService.class); 54 return mockery().mock(FacetFieldsService.class, "facetFieldsService"); 55 } 56 57 @Override 58 @Bean(name = COLLECTION_FACET_SERVICE) 59 public FacetFieldsService collectionFacetFieldsService() { 60 return mockery().mock(FacetFieldsService.class, "collectionFacetFieldsService"); 52 61 } 53 62 … … 59 68 60 69 private WicketTester tester; 61 @Autowired 70 @Autowired(required = true) 62 71 private VloWicketApplication application; 63 @Autowired 72 @Autowired(required = true) 64 73 private Mockery mockery; 65 @Autowired 74 75 @Autowired(required = true) 76 @Qualifier(VloSpringConfig.FACETS_PANEL_SERVICE) 66 77 private FacetFieldsService facetFieldsService; 67 @Autowired 78 79 @Autowired(required = true) 80 @Qualifier(VloSpringConfig.COLLECTION_FACET_SERVICE) 81 private FacetFieldsService collectionsFacetFieldsService; //TODO: Make sure this gets injected separately (like qualifier should ensure) 82 83 @Autowired(required = true) 68 84 private SolrDocumentService documentService; 69 85 … … 81 97 atLeast(1).of(facetFieldsService).getFacetFieldCount(); 82 98 will(returnValue(2L)); 83 oneOf(facetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class)));99 atLeast(1).of(facetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class))); 84 100 will(returnValue(Arrays.asList(new FacetField("language"), new FacetField("resource class")))); 85 101 // 102 // // mock collection facet 103 // atLeast(1).of(collectionsFacetFieldsService).getFacetFieldCount(); 104 // will(returnValue(1L)); 105 // oneOf(collectionsFacetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class))); 106 // will(returnValue(Arrays.asList(new FacetField("collection")))); 107 86 108 // mock search results 87 109 atLeast(1).of(documentService).getDocumentCount(with(any(QueryFacetsSelection.class)));
Note: See TracChangeset
for help on using the changeset viewer.