@Override
- public Optional<UUID> getUserByEmail(String email) {
+ public Optional<UUID> getUserByEmail(String email)
+ {
ResponseEntity<UserDTO> response =
restTemplate.getForEntity(uriTemplate, UserDTO.class, email);
+
HttpStatus status = response.getStatusCode();
UserDTO dto = response.getBody();
- switch (response.getStatusCode()) {
+
+ switch (response.getStatusCode())
+ {
case OK:
return
Optional.of(dto.id);
+
case NOT_FOUND:
return Optional.empty();
+
default:
throw new RuntimeException(status.toString());
}
}
@Override
- public void setPassword(UUID userId, String password) {
+ public void setPassword(UUID userId, String password)
+ {
}
}