Class InternalAggregationTestCase<T extends InternalAggregation>

    • Constructor Detail

      • InternalAggregationTestCase

        public InternalAggregationTestCase()
    • Method Detail

      • createTestInstance

        protected abstract T createTestInstance​(java.lang.String name,
                                                java.util.List<PipelineAggregator> pipelineAggregators,
                                                java.util.Map<java.lang.String,java.lang.Object> metaData)
      • createUnmappedInstance

        protected T createUnmappedInstance​(java.lang.String name,
                                           java.util.List<PipelineAggregator> pipelineAggregators,
                                           java.util.Map<java.lang.String,java.lang.Object> metaData)
        Return an instance on an unmapped field.
      • testReduceRandom

        public void testReduceRandom()
      • mockScriptService

        protected ScriptService mockScriptService()
        overwrite in tests that need it
      • assertReduced

        protected abstract void assertReduced​(T reduced,
                                              java.util.List<T> inputs)
      • createUnmappedInstance

        protected final T createUnmappedInstance​(java.lang.String name)
        Return an instance on an unmapped field.
      • testFromXContent

        public final void testFromXContent()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • testFromXContentWithRandomFields

        public final void testFromXContentWithRandomFields()
                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • assertFromXContent

        protected abstract void assertFromXContent​(T aggregation,
                                                   ParsedAggregation parsedAggregation)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • parseAndAssert

        protected <P extends ParsedAggregation> P parseAndAssert​(InternalAggregation aggregation,
                                                                 boolean shuffled,
                                                                 boolean addRandomFields)
                                                          throws java.io.IOException
        Throws:
        java.io.IOException
      • excludePathsFromXContentInsertion

        protected java.util.function.Predicate<java.lang.String> excludePathsFromXContentInsertion()
        Overwrite this in your test if other than the basic xContent paths should be excluded during insertion of random fields
      • randomNumericDocValueFormat

        protected static DocValueFormat randomNumericDocValueFormat()
        Returns:
        a random DocValueFormat that can be used in aggregations which compute numbers.