package com.avast.metrics.dropwizard.formatting;

import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import org.junit.Test;

import java.util.List;

import static org.junit.Assert.assertEquals;

public class ReferenceConfTest {
    @Test
    public void testDefaultsLoadable() throws Exception {
        Config config = ConfigFactory.load().getConfig("formattingDefaults");

        assertEquals("enable", config.getString("counter.count"));

        assertEquals("enable", config.getString("gauge.value"));

        assertEquals("enable", config.getString("meter.count"));
        assertEquals("disable", config.getString("meter.mean"));
        assertEquals("disable", config.getString("meter.oneMinuteRate"));
        assertEquals("disable", config.getString("meter.fiveMinuteRate"));
        assertEquals("disable", config.getString("meter.fifteenMinuteRate"));

        List<Double> timerPercentiles = config.getDoubleList("histogram.percentiles");
        assertEquals(2, timerPercentiles.size());
        assertEquals(0.5, timerPercentiles.get(0), 0.0);
        assertEquals(0.99, timerPercentiles.get(1), 0.0);
        assertEquals("disable", config.getString("histogram.count"));
        assertEquals("disable", config.getString("histogram.min"));
        assertEquals("disable", config.getString("histogram.max"));
        assertEquals("disable", config.getString("histogram.stdDev"));

        List<Double> histogramPercentiles = config.getDoubleList("timer.percentiles");
        assertEquals(2, histogramPercentiles.size());
        assertEquals(0.5, histogramPercentiles.get(0), 0.0);
        assertEquals(0.99, histogramPercentiles.get(1), 0.0);
        assertEquals("enable", config.getString("timer.count"));
        assertEquals("disable", config.getString("timer.mean"));
        assertEquals("disable", config.getString("timer.min"));
        assertEquals("disable", config.getString("timer.max"));
        assertEquals("disable", config.getString("timer.stdDev"));
        assertEquals("disable", config.getString("timer.oneMinuteRate"));
        assertEquals("disable", config.getString("timer.fiveMinuteRate"));
        assertEquals("disable", config.getString("timer.fifteenMinuteRate"));
    }
}

@@ -414,32 +414,33 @@
 rtEquals(%22enable
+d
 %22, config.getStr
@@ -483,32 +483,33 @@
 rtEquals(%22enable
+d
 %22, config.getStr
@@ -550,32 +550,33 @@
 rtEquals(%22enable
+d
 %22, config.getStr
@@ -617,32 +617,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -683,32 +683,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -758,32 +758,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -834,32 +834,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1166,32 +1166,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1237,32 +1237,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1306,32 +1306,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1375,32 +1375,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1715,24 +1715,25 @@
 uals(%22enable
+d
 %22, config.ge
@@ -1778,32 +1778,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1844,32 +1844,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1909,32 +1909,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -1974,32 +1974,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -2042,32 +2042,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -2117,32 +2117,33 @@
 tEquals(%22disable
+d
 %22, config.getStr
@@ -2201,16 +2201,17 @@
 %22disable
+d
 %22, confi

Change enable/disable to enabled/disabled.