diff --git a/src/main/java/com/seyed/ali/timeentryservice/client/AuthenticationServiceClient.java b/src/main/java/com/seyed/ali/timeentryservice/client/AuthenticationServiceClient.java index 100c63d..d1f925e 100644 --- a/src/main/java/com/seyed/ali/timeentryservice/client/AuthenticationServiceClient.java +++ b/src/main/java/com/seyed/ali/timeentryservice/client/AuthenticationServiceClient.java @@ -16,12 +16,11 @@ @RequiredArgsConstructor public class AuthenticationServiceClient { - private @Value("${authentication.service.user-persistence-controller.base-url}") String authenticationServiceClient_BaseUrl; - private @Value("${authentication.service.user-persistence-controller.handle-user-url}") String authenticationServiceClient_HandleUserUrl; - private final WebClient.Builder webClientBuilder; private final KeycloakSecurityUtil keycloakSecurityUtil; private final ObjectMapper objectMapper; + private @Value("${authentication.service.user-persistence-controller.base-url}") String authenticationServiceClient_BaseUrl; + private @Value("${authentication.service.user-persistence-controller.handle-user-url}") String authenticationServiceClient_HandleUserUrl; private WebClient webClient; @PostConstruct diff --git a/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryControllerTest.java b/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryControllerTest.java index 7edd0f9..141b174 100644 --- a/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryControllerTest.java +++ b/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryControllerTest.java @@ -21,6 +21,7 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -58,13 +59,13 @@ class TimeEntryControllerTest { @BeforeEach void setUp() { - TimeEntryDTO timeEntryDTO = new TimeEntryDTO("1", "2024-05-11 08:00:00", "2024-05-11 10:00:00", "02:00:00"); + TimeEntryDTO timeEntryDTO = new TimeEntryDTO("1", "2024-05-11 08:00:00", "2024-05-11 10:00:00", false, BigDecimal.ZERO.toString(), "02:00:00"); this.timeEntries.add(timeEntryDTO); TimeSegmentDTO timeSegmentDTO = new TimeSegmentDTO("1", "2024-05-11 08:00:00", "2024-05-11 10:00:00", "02:00:00", "01"); this.timeSegmentDTOList.add(timeSegmentDTO); - this.timeEntryResponse = new TimeEntryResponse("1", this.timeSegmentDTOList, "02:00:00"); + this.timeEntryResponse = new TimeEntryResponse("1", this.timeSegmentDTOList, false, BigDecimal.ZERO.toString(), "02:00:00"); this.timeEntriesResponse.add(timeEntryResponse); } diff --git a/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryTrackingControllerTest.java b/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryTrackingControllerTest.java index ec85f0b..0a75980 100644 --- a/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryTrackingControllerTest.java +++ b/src/test/java/com/seyed/ali/timeentryservice/controller/TimeEntryTrackingControllerTest.java @@ -53,7 +53,7 @@ class TimeEntryTrackingControllerTest { @BeforeEach void setUp() { - TimeEntryDTO timeEntryDTO = new TimeEntryDTO("1", "2024-05-11 08:00:00", "2024-05-11 10:00:00", "02:00:00"); + TimeEntryDTO timeEntryDTO = new TimeEntryDTO("1", "2024-05-11 08:00:00", "2024-05-11 10:00:00", false, BigDecimal.ZERO.toString(), "02:00:00"); this.timeEntries.add(timeEntryDTO); } diff --git a/src/test/java/com/seyed/ali/timeentryservice/service/TimeEntryServiceImplTest.java b/src/test/java/com/seyed/ali/timeentryservice/service/TimeEntryServiceImplTest.java index 86fe6b5..8f10363 100644 --- a/src/test/java/com/seyed/ali/timeentryservice/service/TimeEntryServiceImplTest.java +++ b/src/test/java/com/seyed/ali/timeentryservice/service/TimeEntryServiceImplTest.java @@ -16,6 +16,7 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; +import java.math.BigDecimal; import java.time.Duration; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; @@ -114,7 +115,7 @@ void getUsersTimeEntry() { @Test public void addTimeEntryManuallyTest_WithDuration() { - TimeEntryDTO timeEntryDTO = new TimeEntryDTO(null, this.startTimeStr, this.endTimeStr, this.durationStr); + TimeEntryDTO timeEntryDTO = new TimeEntryDTO(null, this.startTimeStr, this.endTimeStr, false, BigDecimal.ZERO.toString(), this.durationStr); when(this.timeParser.parseStringToLocalDateTime(this.startTimeStr)) .thenReturn(this.startTime); @@ -147,7 +148,7 @@ public void addTimeEntryManuallyTest_WithDuration() { @Test public void addTimeEntryManuallyTest_WithoutDuration() { // Given - TimeEntryDTO timeEntryDTO = new TimeEntryDTO(null, this.startTimeStr, this.endTimeStr, null); + TimeEntryDTO timeEntryDTO = new TimeEntryDTO(null, this.startTimeStr, this.endTimeStr, false, BigDecimal.ZERO.toString(), null); when(this.timeParser.parseStringToLocalDateTime(this.startTimeStr)) .thenReturn(this.startTime); @@ -177,7 +178,7 @@ public void addTimeEntryManuallyTest_WithoutDuration() { public void updateTimeEntryTest() { // Given String id = "Some_timeEntry_id"; - TimeEntryDTO timeEntryDTO = new TimeEntryDTO(null, this.startTimeStr, this.endTimeStr, this.durationStr); + TimeEntryDTO timeEntryDTO = new TimeEntryDTO(null, this.startTimeStr, this.endTimeStr, false, BigDecimal.ZERO.toString(), this.durationStr); when(this.timeEntryRepository.findById(id)) .thenReturn(Optional.of(this.timeEntry));