@@ -49,55 +49,55 @@ func TestRetainsMetric(t *testing.T) {
4949}
5050
5151func TestMapsSingleStringValue (t * testing.T ) {
52- mapper := EnumMapper {Fields : []Mapping {{Source : "string_value" , ValueMappings : map [string ]interface {}{"test" : int64 (1 )}}}}
52+ mapper := EnumMapper {Mappings : []Mapping {{Field : "string_value" , ValueMappings : map [string ]interface {}{"test" : int64 (1 )}}}}
5353
5454 fields := calculateProcessedValues (mapper , createTestMetric ())
5555
5656 assertFieldValue (t , 1 , "string_value" , fields )
5757}
5858
5959func TestNoFailureOnMappingsOnNonStringValuedFields (t * testing.T ) {
60- mapper := EnumMapper {Fields : []Mapping {{Source : "int_value" , ValueMappings : map [string ]interface {}{"13i" : int64 (7 )}}}}
60+ mapper := EnumMapper {Mappings : []Mapping {{Field : "int_value" , ValueMappings : map [string ]interface {}{"13i" : int64 (7 )}}}}
6161
6262 fields := calculateProcessedValues (mapper , createTestMetric ())
6363
6464 assertFieldValue (t , 13 , "int_value" , fields )
6565}
6666
6767func TestMapSingleBoolValue (t * testing.T ) {
68- mapper := EnumMapper {Fields : []Mapping {{Source : "true_value" , ValueMappings : map [string ]interface {}{"true" : int64 (1 )}}}}
68+ mapper := EnumMapper {Mappings : []Mapping {{Field : "true_value" , ValueMappings : map [string ]interface {}{"true" : int64 (1 )}}}}
6969
7070 fields := calculateProcessedValues (mapper , createTestMetric ())
7171
7272 assertFieldValue (t , 1 , "true_value" , fields )
7373}
7474
7575func TestMapsToDefaultValueOnUnknownSourceValue (t * testing.T ) {
76- mapper := EnumMapper {Fields : []Mapping {{Source : "string_value" , Default : int64 (42 ), ValueMappings : map [string ]interface {}{"other" : int64 (1 )}}}}
76+ mapper := EnumMapper {Mappings : []Mapping {{Field : "string_value" , Default : int64 (42 ), ValueMappings : map [string ]interface {}{"other" : int64 (1 )}}}}
7777
7878 fields := calculateProcessedValues (mapper , createTestMetric ())
7979
8080 assertFieldValue (t , 42 , "string_value" , fields )
8181}
8282
8383func TestDoNotMapToDefaultValueKnownSourceValue (t * testing.T ) {
84- mapper := EnumMapper {Fields : []Mapping {{Source : "string_value" , Default : int64 (42 ), ValueMappings : map [string ]interface {}{"test" : int64 (1 )}}}}
84+ mapper := EnumMapper {Mappings : []Mapping {{Field : "string_value" , Default : int64 (42 ), ValueMappings : map [string ]interface {}{"test" : int64 (1 )}}}}
8585
8686 fields := calculateProcessedValues (mapper , createTestMetric ())
8787
8888 assertFieldValue (t , 1 , "string_value" , fields )
8989}
9090
9191func TestNoMappingWithoutDefaultOrDefinedMappingValue (t * testing.T ) {
92- mapper := EnumMapper {Fields : []Mapping {{Source : "string_value" , ValueMappings : map [string ]interface {}{"other" : int64 (1 )}}}}
92+ mapper := EnumMapper {Mappings : []Mapping {{Field : "string_value" , ValueMappings : map [string ]interface {}{"other" : int64 (1 )}}}}
9393
9494 fields := calculateProcessedValues (mapper , createTestMetric ())
9595
9696 assertFieldValue (t , "test" , "string_value" , fields )
9797}
9898
9999func TestWritesToDestination (t * testing.T ) {
100- mapper := EnumMapper {Fields : []Mapping {{Source : "string_value" , Destination : "string_code" , ValueMappings : map [string ]interface {}{"test" : int64 (1 )}}}}
100+ mapper := EnumMapper {Mappings : []Mapping {{Field : "string_value" , Dest : "string_code" , ValueMappings : map [string ]interface {}{"test" : int64 (1 )}}}}
101101
102102 fields := calculateProcessedValues (mapper , createTestMetric ())
103103
0 commit comments