package com.clearspring.thetan.metricCatcher;

import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.yammer.metrics.core.GaugeMetric;

public class JSONMetricTest {
    JSONMetric  jsonMetric;
    
    @Before
    public void setUp() throws Exception {
        jsonMetric = new JSONMetric();
    }

    @After
    public void tearDown() throws Exception {
    }

    @Test
    public void testSetType_MetricType() {
        jsonMetric.setType(MetricType.GAUGE);
        assertEquals(MetricType.GAUGE, jsonMetric.getType());
    }
    
    @Test
    public void testSetType_TypeName() {
        jsonMetric.setType("gauge");
        assertEquals(MetricType.GAUGE, jsonMetric.getType());
    }
    
    @Test
    public void testGetKlass_TypeName() {
        jsonMetric.setType("gauge");
        assertEquals(GaugeMetric.class, jsonMetric.getMetricClass());
    }
}

@@ -501,32 +501,23 @@
 setType(
-MetricType.GAUGE
+%22gauge%22
 );%0A     

Fix setType in JSONMetricTest