From 1628e5f7e793a6eea1eda87a64e54a418bb57005 Mon Sep 17 00:00:00 2001 From: alexZ7000 Date: Tue, 15 Oct 2024 16:46:25 -0300 Subject: [PATCH] rerun ci --- src/main/resources/application.properties | 3 ++- .../controller/UserControllerIntegrationTest.java | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 7f4d0f9..c11ae11 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,4 +5,5 @@ spring.datasource.password=${DATABASE_PASSWORD} spring.jpa.hibernate.ddl-auto=${JPA_DDL} spring.jpa.open-in-view=${JPA_OPEN_IN_VIEW} -spring.jpa.show-sql=${JPA_SHOW_SQL} \ No newline at end of file +spring.jpa.show-sql=${JPA_SHOW_SQL} +spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect diff --git a/src/test/java/com/example/comerce/integration/controller/UserControllerIntegrationTest.java b/src/test/java/com/example/comerce/integration/controller/UserControllerIntegrationTest.java index f415842..7969240 100644 --- a/src/test/java/com/example/comerce/integration/controller/UserControllerIntegrationTest.java +++ b/src/test/java/com/example/comerce/integration/controller/UserControllerIntegrationTest.java @@ -1,6 +1,7 @@ package com.example.comerce.integration.controller; import com.example.comerce.core.dto.AddressDTO; +import com.example.comerce.core.dto.OrderDTO; import com.example.comerce.core.dto.UserDTO; import com.example.comerce.core.entities.User; import com.example.comerce.core.services.UserService; @@ -17,9 +18,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; -import java.util.Collections; -import java.util.Optional; -import java.util.UUID; +import java.util.*; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; @@ -106,6 +105,12 @@ public void testCreateUser() throws Exception { address.setState("Estado Exemplo"); userDTO.setAddress(address); + final OrderDTO order = new OrderDTO(); + order.setDate(new Date()); + order.setDiscount(10.0); + order.setTotal_price(100.0); + userDTO.setOrders(List.of(order)); + final User user = userDTO.toEntity(); user.setUser_id(UUID.randomUUID());