@@ -0,0 +1,1959 @@
+package com.spotify.heroic.aggregation;%0A%0Aimport com.google.common.collect.ImmutableList;%0Aimport com.google.common.collect.ImmutableMap;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0A%0Aimport java.util.Map;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.doReturn;%0Aimport static org.mockito.Mockito.doThrow;%0Aimport static org.mockito.Mockito.mock;%0A%0Apublic class CoreAggregationFactoryTest %7B%0A    @Rule%0A    public ExpectedException expected = ExpectedException.none();%0A%0A    private final RuntimeException e = new RuntimeException(%22exception%22);%0A%0A    private Aggregation aggregation;%0A    private CoreAggregationFactory factory;%0A%0A    @Before%0A    public void setup() %7B%0A        aggregation = mock(Aggregation.class);%0A%0A        final AggregationDSL throwing = mock(AggregationDSL.class);%0A        doThrow(e).when(throwing).build(any(AggregationArguments.class));%0A%0A        final AggregationDSL working = mock(AggregationDSL.class);%0A        doReturn(aggregation).when(working).build(any(AggregationArguments.class));%0A%0A        final Map%3CString, AggregationDSL%3E builderMap =%0A            ImmutableMap.of(%22throwing%22, throwing, %22working%22, working);%0A        factory = new CoreAggregationFactory(builderMap);%0A    %7D%0A%0A    @Test%0A    public void builderMissing() %7B%0A        expected.expect(MissingAggregation.class);%0A        expected.expectMessage(%22Missing aggregation missing%22);%0A%0A        factory.build(%22missing%22, ImmutableList.of(), ImmutableMap.of());%0A    %7D%0A%0A    @Test%0A    public void builderThrowing() %7B%0A        expected.expect(RuntimeException.class);%0A        expected.expectMessage(%22throwing: exception%22);%0A%0A        factory.build(%22throwing%22, ImmutableList.of(), ImmutableMap.of());%0A    %7D%0A%0A    @Test%0A    public void builderWorking() %7B%0A        assertEquals(aggregation, factory.build(%22working%22, ImmutableList.of(), ImmutableMap.of()));%0A    %7D%0A%7D%0A

add tests for CoreAggregationFactory