diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/encryption/EncryptionController.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/encryption/EncryptionController.java index 9b5efb06..1241cdd9 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/encryption/EncryptionController.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/encryption/EncryptionController.java @@ -92,7 +92,6 @@ public class EncryptionController { } @ExceptionHandler(KeyFormatException.class) - @ResponseBody public ResponseEntity> keyFormat() { Map body = new HashMap<>(); body.put("status", "BAD_REQUEST"); @@ -101,9 +100,8 @@ public class EncryptionController { } @ExceptionHandler(KeyNotAvailableException.class) - @ResponseBody public ResponseEntity> keyUnavailable() { - Map body = new HashMap(); + Map body = new HashMap<>(); body.put("status", "NOT_FOUND"); body.put("description", "No public key available"); return new ResponseEntity<>(body, HttpStatus.NOT_FOUND); @@ -112,7 +110,7 @@ public class EncryptionController { @RequestMapping(value = "encrypt/status", method = RequestMethod.GET) public Map status() { checkEncryptorInstalled("application", "default"); - return Collections.singletonMap("status", "OK"); + return Collections.singletonMap("status", "OK"); } @RequestMapping(value = "encrypt", method = RequestMethod.POST) @@ -213,27 +211,24 @@ public class EncryptionController { } @ExceptionHandler(KeyNotInstalledException.class) - @ResponseBody public ResponseEntity> notInstalled() { - Map body = new HashMap(); + Map body = new HashMap<>(); body.put("status", "NO_KEY"); body.put("description", "No key was installed for encryption service"); return new ResponseEntity<>(body, HttpStatus.NOT_FOUND); } @ExceptionHandler(EncryptionTooWeakException.class) - @ResponseBody public ResponseEntity> encryptionTooWeak() { - Map body = new HashMap(); + Map body = new HashMap<>(); body.put("status", "INVALID"); body.put("description", "The encryption algorithm is not strong enough"); return new ResponseEntity<>(body, HttpStatus.NOT_FOUND); } @ExceptionHandler(InvalidCipherException.class) - @ResponseBody public ResponseEntity> invalidCipher() { - Map body = new HashMap(); + Map body = new HashMap<>(); body.put("status", "INVALID"); body.put("description", "Text not encrypted with this key"); return new ResponseEntity<>(body, HttpStatus.BAD_REQUEST);