From 6a5b672c0c26cabebc5147c9710449096672132b Mon Sep 17 00:00:00 2001 From: Murilo Kakazu Date: Sat, 27 Jul 2024 05:02:43 -0300 Subject: [PATCH] style: code linting --- .../payment/CollectOrderPaymentViaCashUseCase.java | 1 - .../infrastructure/gateways/MercadoPagoGateway.java | 10 ++++------ .../presentation/controllers/PaymentResource.java | 3 ++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/payment/CollectOrderPaymentViaCashUseCase.java b/src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/payment/CollectOrderPaymentViaCashUseCase.java index fc4e9a1..1d485a2 100644 --- a/src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/payment/CollectOrderPaymentViaCashUseCase.java +++ b/src/main/java/br/com/fiap/grupo30/fastfood/domain/usecases/payment/CollectOrderPaymentViaCashUseCase.java @@ -2,7 +2,6 @@ import br.com.fiap.grupo30.fastfood.domain.entities.Order; import br.com.fiap.grupo30.fastfood.infrastructure.gateways.OrderGateway; -import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.CollectPaymentViaCashRequest; import br.com.fiap.grupo30.fastfood.presentation.presenters.dto.OrderDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/gateways/MercadoPagoGateway.java b/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/gateways/MercadoPagoGateway.java index 76b5b28..4178751 100644 --- a/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/gateways/MercadoPagoGateway.java +++ b/src/main/java/br/com/fiap/grupo30/fastfood/infrastructure/gateways/MercadoPagoGateway.java @@ -48,12 +48,10 @@ public MercadoPagoGateway(MercadoPagoOrderMapper orderMapper) { } private Map getHeaders() { - return new HashMap() { - { - put("Authorization", String.format("Bearer %s", privateAccessToken)); - put("Content-type", "application/json"); - } - }; + Map headers = new HashMap(); + headers.put("Authorization", String.format("Bearer %s", privateAccessToken)); + headers.put("Content-type", "application/json"); + return headers; } private HttpResponse makeRequest(String httpMethod, URI resourceUri) throws Exception { diff --git a/src/main/java/br/com/fiap/grupo30/fastfood/presentation/controllers/PaymentResource.java b/src/main/java/br/com/fiap/grupo30/fastfood/presentation/controllers/PaymentResource.java index bad287f..9415fd5 100644 --- a/src/main/java/br/com/fiap/grupo30/fastfood/presentation/controllers/PaymentResource.java +++ b/src/main/java/br/com/fiap/grupo30/fastfood/presentation/controllers/PaymentResource.java @@ -43,7 +43,8 @@ public ResponseEntity generateQrCodeForPaymentCollection( @Operation(summary = "Collect payment by cash") public ResponseEntity collectPaymentByBash( @PathVariable Long orderId, @RequestBody CollectPaymentViaCashRequest request) { - OrderDTO order = this.collectOrderPaymentViaCashUseCase.execute(orderId, request.getAmount()); + OrderDTO order = + this.collectOrderPaymentViaCashUseCase.execute(orderId, request.getAmount()); return ResponseEntity.ok().body(order); } }