Skip to content

Commit

Permalink
Optimise imports
Browse files Browse the repository at this point in the history
  • Loading branch information
karlbaker02 committed Oct 24, 2024
1 parent 4259536 commit 53a2705
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import uk.gov.justice.laa.crime.evidence.staticdata.entity.IncomeEvidenceRequiredItemEntity;
import uk.gov.justice.laa.crime.evidence.staticdata.projection.IncomeEvidenceRequiredItemProjection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package uk.gov.justice.laa.crime.evidence.repository;

import java.util.List;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import uk.gov.justice.laa.crime.evidence.staticdata.enums.OtherEvidenceTypes;
import uk.gov.justice.laa.crime.util.DateUtil;

import java.util.Date;

@Slf4j
@Service
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,32 @@ public class MeansAssessmentApiService {
@Qualifier("cmaApiClient")
private final RestAPIClient cmaApiClient;
private final ServicesConfiguration configuration;
private static final String REQUEST_STRING = "Request to Means Assessment Api: {}";
private static final String RESPONSE_STRING = "Response from Means Assessment Api: {}";

public ApiGetMeansAssessmentResponse find(Integer assessmentId) {
log.debug(REQUEST_STRING, assessmentId);
ApiGetMeansAssessmentResponse response = cmaApiClient.get(
new ParameterizedTypeReference<>() {
},
configuration.getCmaApi().getEndpoints().getFindUrl(),
assessmentId
);
log.debug(RESPONSE_STRING, response);

return response;
}

public ApiMeansAssessmentResponse update(ApiUpdateMeansAssessmentRequest request) {
log.debug(REQUEST_STRING, request);
ApiMeansAssessmentResponse response = cmaApiClient.put(
request,
new ParameterizedTypeReference<>() {
},
configuration.getCmaApi().getEndpoints().getUpdateUrl(),
Map.of()
);
log.debug(RESPONSE_STRING, response);

return response;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package uk.gov.justice.laa.crime.evidence.controller;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
Expand All @@ -16,8 +17,6 @@
import uk.gov.justice.laa.crime.evidence.service.EvidenceService;
import uk.gov.justice.laa.crime.util.RequestBuilderUtils;

import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@WebMvcTest(IncomeEvidenceController.class)
@AutoConfigureMockMvc(addFilters = false)
class IncomeEvidenceControllerTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ void givenOutstandingEvidence_whenCheckEvidenceReceivedIsInvoked_thenReturnFalse
new ApiIncomeEvidence(2, null, IncomeEvidenceType.BANK_STATEMENT, false, "Bank statement"),
new ApiIncomeEvidence(3, null, IncomeEvidenceType.EMP_LETTER, true, "Employment letter")
);
List<ApiIncomeEvidence> partnerEvidenceItems = new ArrayList<>();

IncomeEvidenceService incomeEvidenceService = new IncomeEvidenceService(incomeEvidenceRequiredRepository, incomeEvidenceRequiredItemRepository);

Expand Down Expand Up @@ -265,7 +264,6 @@ void givenNoOutstandingEvidence_whenCheckEvidenceReceivedIsInvoked_thenReturnTru
new ApiIncomeEvidence(35, null, IncomeEvidenceType.BANK_STATEMENT, false, "Bank statement"),
new ApiIncomeEvidence(36, LocalDate.of(2024, 9, 1), IncomeEvidenceType.EMP_LETTER, true, "Employment letter")
);
List<ApiIncomeEvidence> partnerEvidenceItems = new ArrayList<>();

IncomeEvidenceService incomeEvidenceService = new IncomeEvidenceService(incomeEvidenceRequiredRepository, incomeEvidenceRequiredItemRepository);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package uk.gov.justice.laa.crime.evidence.service;

import static org.junit.jupiter.api.Assertions.assertThrows;

import java.time.LocalDate;
import org.assertj.core.api.SoftAssertions;
import org.assertj.core.api.junit.jupiter.InjectSoftAssertions;
import org.assertj.core.api.junit.jupiter.SoftAssertionsExtension;
Expand All @@ -11,11 +14,6 @@
import uk.gov.justice.laa.crime.evidence.dto.EvidenceDTO;
import uk.gov.justice.laa.crime.util.DateUtil;

import java.time.LocalDate;
import java.util.Date;

import static org.junit.jupiter.api.Assertions.assertThrows;

@ExtendWith(MockitoExtension.class)
@ExtendWith(SoftAssertionsExtension.class)
class IncomeEvidenceValidationServiceTest {
Expand Down

0 comments on commit 53a2705

Please sign in to comment.