From 725186bf9b3c0c79eee28ba95b12ee704553eb8c Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Tue, 7 Feb 2023 09:19:01 +0100 Subject: [PATCH 1/2] Use @GetMapping in MetricController --- .../java/com/iexec/core/metric/MetricController.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/iexec/core/metric/MetricController.java b/src/main/java/com/iexec/core/metric/MetricController.java index 5c9c7e6f2..215758f69 100644 --- a/src/main/java/com/iexec/core/metric/MetricController.java +++ b/src/main/java/com/iexec/core/metric/MetricController.java @@ -16,10 +16,8 @@ package com.iexec.core.metric; - import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import static org.springframework.http.ResponseEntity.ok; @@ -27,15 +25,13 @@ @RestController public class MetricController { - - private MetricService metricService; + private final MetricService metricService; public MetricController(MetricService metricService) { this.metricService = metricService; } - - @RequestMapping(method = RequestMethod.GET, path = "/metrics") + @GetMapping("/metrics") public ResponseEntity getPlatformMetric() { return ok(metricService.getPlatformMetrics()); } From f2aff64134fcc65fd15ddd46a9b2e2948f8cfdae Mon Sep 17 00:00:00 2001 From: Jeremy Bernard Date: Tue, 7 Feb 2023 17:52:45 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md for next release --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d37f7078..6e448f1af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. * Improve code quality and tests. * Removed unused variables in configuration. * Use existing `toString()` method to serialize and hash scheduler public configuration. +* Use recommended annotation in `MetricController`. ### Dependency Upgrades * Upgrade to Spring Boot 2.6.14. * Upgrade to Gradle 7.6.