Ignore:
Timestamp:
02/25/14 16:33:17 (10 years ago)
Author:
twagoo
Message:

Added single facet panel for collection selection

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  
    33import eu.clarin.cmdi.vlo.wicket.pages.FacetedSearchPage;
    44import eu.clarin.cmdi.vlo.VloWicketApplication;
     5import eu.clarin.cmdi.vlo.config.VloConfig;
    56import eu.clarin.cmdi.vlo.config.VloSpringConfig;
    67import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
     
    2728
    2829import static org.hamcrest.core.AnyOf.*;
     30import org.springframework.beans.factory.annotation.Qualifier;
    2931
    3032/**
     
    4850
    4951        @Override
     52        @Bean(name = VloSpringConfig.FACETS_PANEL_SERVICE)
    5053        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");
    5261        }
    5362
     
    5968
    6069    private WicketTester tester;
    61     @Autowired
     70    @Autowired(required = true)
    6271    private VloWicketApplication application;
    63     @Autowired
     72    @Autowired(required = true)
    6473    private Mockery mockery;
    65     @Autowired
     74
     75    @Autowired(required = true)
     76    @Qualifier(VloSpringConfig.FACETS_PANEL_SERVICE)
    6677    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)
    6884    private SolrDocumentService documentService;
    6985
     
    8197                atLeast(1).of(facetFieldsService).getFacetFieldCount();
    8298                will(returnValue(2L));
    83                 oneOf(facetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class)));
     99                atLeast(1).of(facetFieldsService).getFacetFields(with(any(QueryFacetsSelection.class)));
    84100                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
    86108                // mock search results
    87109                atLeast(1).of(documentService).getDocumentCount(with(any(QueryFacetsSelection.class)));
Note: See TracChangeset for help on using the changeset viewer.