Skip to content

Commit

Permalink
CIV-9249 Added sonar exclusions for model classes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepthidoppalapudihmcts committed Jul 13, 2023
1 parent c2f86d4 commit 98c78ee
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sonarqube {
property "sonar.projectName", "Reform :: civil-orchestrator-service"
property "sonar.projectKey", "uk.gov.hmcts.reform:civil-orchestrator-service"
property "sonar.coverage.jacoco.xmlReportPaths", "${jacocoTestReport.reports.xml.destination.path}"
property "sonar.coverage.exclusions", "**/model/**, **/config/**/*Configuration.java, **/testingsupport/**, **/*ExternalTaskListener.java, **/stereotypes/**, **/*Exception.java"
property "sonar.coverage.exclusions", "**/requestbody/**", "**/responsebody/**", "**/config/**/*Configuration.java, **/stereotypes/**, **/exceptions/**, **/*Exception.java"
property "sonar.cpd.exclusions", "**/*DocumentManagementService.java"
property "sonar.host.url", "https://sonar.reform.hmcts.net/"
}
Expand Down Expand Up @@ -258,19 +258,22 @@ dependencies {
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion

implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-hystrix', version: '2.2.10.RELEASE'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '3.1.6'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-openfeign-core', version: '3.1.6'

implementation group: 'com.github.hmcts', name: 'ccd-client', version: '4.9.1'

annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion

implementation "org.mapstruct:mapstruct:${mapstructVersion}"
implementation "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok-mapstruct-binding:0.2.0"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"

}

mainClassName = 'uk.gov.hmcts.reform.civil.Application'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public ResponseEntity<CreateClaimErrorResponse> createClaimSdt(@Valid @RequestBo
private void validateSdtRequestId(String sdtRequestId) {
String sdtRequestIdFromCcd = createClaimFromSdtService.getSdtRequestId();
if (sdtRequestIdFromCcd.equalsIgnoreCase(sdtRequestId)) {
throw new BadRequestException(String.format("201 Request already processed"));
throw new BadRequestException(" Request already processed");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
)
public class CreateClaimRequest {

// TODO remove bulkCustomerId, not part of payload, believe it is sent as header
@NotNull(message = "Bulk Customer Id should not be null")
@Pattern(regexp = "[1-9]\\d{7}", message = "Bulk customer Id is in wrong format")
private String bulkCustomerId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ private void validateRequestParams(CreateClaimRequest createClaimRequest) {

var idamId = "testIdamIDMatchesBulkId";
if (!idamId.equals(createClaimRequest.getBulkCustomerId())) {
throw new InvalidUserException(String.format("401 Unknown useur"));
throw new InvalidUserException("Unknown useur");
}

// TODO check if payment is valid
var paymentValid = "valid";
if (paymentValid.equals("notValid")) {
throw new PaymentNotFoundException(String.format("003 D/D facility not set"));
throw new PaymentNotFoundException("003 D/D facility not set");
}

// TODO Determine if customer is registered as solictor....customerID?
Boolean customerIsSolicitor = true;
if (customerIsSolicitor.equals(false)) {
throw new ClaimantValidationException(String.format("005 claimant details missing"));
throw new ClaimantValidationException("005 claimant details missing");
}

}
Expand All @@ -53,7 +53,6 @@ public CreateClaimCCD processSdtClaim(CreateClaimRequest createClaimRequest) {
}

public String getSdtRequestId() {
var stdRequestId = "unique";
return stdRequestId;
return "unique";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

public class AddressTypeTest {
class AddressTypeTest {

private Validator validator;
private AddressType addressType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

public class ClaimantTypeTest {
class ClaimantTypeTest {
private Validator validator;
private ClaimantType claimantType;
private Set<ConstraintViolation<ClaimantType>> constraintViolations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

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

public class DefendantTypeTest {
class DefendantTypeTest {

private Validator validator;
private DefendantType defendantType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

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

public class InterestTest {
class InterestTest {

private Validator validator;
private Interest interest;
Expand Down

0 comments on commit 98c78ee

Please sign in to comment.