Search in sources :

Example 21 with MetadataHelper

use of datawave.query.util.MetadataHelper in project datawave by NationalSecurityAgency.

the class FacetCheckTest method before.

@Before
public void before() throws TableNotFoundException, IllegalAccessException, InstantiationException {
    Multimap<String, String> facets = HashMultimap.create();
    facets.put("FACET1", "VALUE");
    facets.put("FACET2", "VALUE");
    facets.put("FACET3", "VALUE");
    ShardQueryConfiguration shardQueryConfiguration = mock(ShardQueryConfiguration.class);
    FacetedConfiguration facetedConfiguration = mock(FacetedConfiguration.class);
    expect(facetedConfiguration.getFacetMetadataTableName()).andReturn("facetMetadata");
    MetadataHelper metadataHelper = mock(MetadataHelper.class);
    expect(metadataHelper.isIndexed(anyString(), anyObject())).andAnswer(() -> indexedFields.contains(getCurrentArguments()[0]));
    expect(metadataHelper.getFacets("facetMetadata")).andReturn(facets);
    replay(shardQueryConfiguration, facetedConfiguration, metadataHelper);
    facetCheck = new FacetCheck(shardQueryConfiguration, facetedConfiguration, metadataHelper);
}
Also used : MetadataHelper(datawave.query.util.MetadataHelper) EasyMock.anyString(org.easymock.EasyMock.anyString) ShardQueryConfiguration(datawave.query.config.ShardQueryConfiguration) Before(org.junit.Before)

Aggregations

MetadataHelper (datawave.query.util.MetadataHelper)21 ShardQueryConfiguration (datawave.query.config.ShardQueryConfiguration)16 HashSet (java.util.HashSet)14 ASTJexlScript (org.apache.commons.jexl2.parser.ASTJexlScript)14 CompositeFunctionsTest (datawave.query.CompositeFunctionsTest)13 Test (org.junit.Test)13 ExceededOrThresholdMarkerJexlNode (datawave.query.jexl.nodes.ExceededOrThresholdMarkerJexlNode)5 ExceededValueThresholdMarkerJexlNode (datawave.query.jexl.nodes.ExceededValueThresholdMarkerJexlNode)5 JexlNode (org.apache.commons.jexl2.parser.JexlNode)5 Type (datawave.data.type.Type)3 ScannerFactory (datawave.query.tables.ScannerFactory)2 QueryException (datawave.webservice.query.exception.QueryException)2 Date (java.util.Date)2 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)2 ASTOrNode (org.apache.commons.jexl2.parser.ASTOrNode)2 HashMultimap (com.google.common.collect.HashMultimap)1 Multimap (com.google.common.collect.Multimap)1 EdgeExtendedSummaryConfiguration (datawave.query.config.EdgeExtendedSummaryConfiguration)1 ShardIndexQueryConfiguration (datawave.query.config.ShardIndexQueryConfiguration)1 DatawaveKey (datawave.query.data.parsers.DatawaveKey)1