Merge pull request #11000 from kwoyke/JAVA-6091

JAVA-6091: Fix enum comparison
This commit is contained in:
Loredana Crusoveanu 2021-07-06 16:01:25 +03:00 committed by GitHub
commit 1660e33cf9
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ public class CustomerService {
final ObjectMapper mapper = new ObjectMapper();
final Customer customer = mapper.convertValue(customerData, Customer.class);
if (Operation.DELETE.name().equals(operation.name())) {
if (Operation.DELETE == operation) {
customerRepository.deleteById(customer.getId());
} else {
customerRepository.save(customer);