@@ -48,9 +48,9 @@ public void theMetricForEndpointWithParameterAndStatusResponseHasIncrementedBy(S
48
48
int increment ) {
49
49
var path = String .format ("%s/%s" , endpoint .getPath (), pathParameter );
50
50
var initialCount = getResourceAndStatusCounterValue (metricsState .getInitialMetrics (), metricName ,
51
- endpoint .getMethod (), path , statusCode );
51
+ endpoint .getMethod (), path , statusCode );
52
52
var newCount = getResourceAndStatusCounterValue (metricsState .getNewMetrics (), metricName ,
53
- endpoint .getMethod (), path , statusCode );
53
+ endpoint .getMethod (), path , statusCode );
54
54
assertThat (newCount ).isEqualTo (initialCount + increment );
55
55
}
56
56
@@ -61,9 +61,9 @@ private double getResourceAndStatusCounterValue(List<MetricFamily> metrics, Stri
61
61
private double getResourceAndStatusCounterValue (List <MetricFamily > metrics , String metricName , String method ,
62
62
String path , String status ) {
63
63
return sumCounterMetric (metrics , metricName , List .of (
64
- metric -> metric .getLabels ().get ("method" ).equals (method ),
65
- metric -> metric .getLabels ().get ("path" ).equals (path ),
66
- metric -> metric .getLabels ().get ("status" ).equals (status )));
64
+ metric -> metric .getLabels ().get ("method" ).equals (method ),
65
+ metric -> metric .getLabels ().get ("path" ).equals (path ),
66
+ metric -> metric .getLabels ().get ("status" ).equals (status )));
67
67
}
68
68
69
69
private double sumCounterMetric (List <MetricFamily > metricFamilies , String metricName , List <Predicate <Metric >> filters ) {
@@ -73,15 +73,15 @@ private double sumCounterMetric(List<MetricFamily> metricFamilies, String metric
73
73
private double sumMetric (List <MetricFamily > metricFamilies , String metricName , MetricType metricType , List <Predicate <Metric >> filters ) {
74
74
var metricsStream = getMetricsStreamWithNameAndType (metricFamilies , metricName , metricType );
75
75
return applyFilters (metricsStream , filters )
76
- .map (MetricWrapper ::new )
77
- .mapToDouble (MetricWrapper ::getValue )
78
- .sum ();
76
+ .map (MetricWrapper ::new )
77
+ .mapToDouble (MetricWrapper ::getValue )
78
+ .sum ();
79
79
}
80
80
81
81
private Stream <Metric > getMetricsStreamWithNameAndType (List <MetricFamily > metricFamilies , String metricName , MetricType metricType ) {
82
82
return metricFamilies .stream ()
83
- .filter (mf -> mf .getName ().equals (metricName ) && mf .getType ().equals (metricType ))
84
- .flatMap (mf -> mf .getMetrics ().stream ());
83
+ .filter (mf -> mf .getName ().equals (metricName ) && mf .getType ().equals (metricType ))
84
+ .flatMap (mf -> mf .getMetrics ().stream ());
85
85
}
86
86
87
87
private Stream <Metric > applyFilters (Stream <Metric > metricsStream , List <Predicate <Metric >> filters ) {
0 commit comments