Skip to content

Commit 1405654

Browse files
fix: Code review test (#13)
Co-authored-by: stefanodel <[email protected]>
1 parent 6e75484 commit 1405654

File tree

5 files changed

+32
-33
lines changed

5 files changed

+32
-33
lines changed

.devops/code-review-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ steps:
3232
extraProperties: |
3333
sonar.projectKey=$(SONARCLOUD_PROJECT_KEY)
3434
sonar.projectName=$(SONARCLOUD_PROJECT_NAME)
35-
sonar.exclusions='**/enums/**, **/model/**, **/dto/**, **/*Constant*, **/*Config.java, **/*Scheduler.java, **/*Application.java, **/src/test/**, **/Dummy*.java'
35+
sonar.exclusions='**/enums/**, **/model/**, **/stub/**, **/dto/**, **/*Constant*, **/*Config.java, **/*Scheduler.java, **/*Application.java, **/src/test/**, **/Dummy*.java'
3636
3737
# - task: DownloadSecureFile@1
3838
# displayName: 'download settings.xml for Maven'

.github/workflows/code-review.yml

+27-28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: EMD - CodeReview
1+
name: SonarCloud Analysis
22

33
on:
44
pull_request:
@@ -8,43 +8,42 @@ on:
88
- synchronize
99

1010
jobs:
11-
build:
11+
sonarcloud:
12+
name: SonarCloud Analysis
1213
runs-on: ubuntu-latest
14+
1315
steps:
14-
- name: Checkout sources
16+
- name: Checkout code
1517
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
16-
with:
17-
fetch-depth: 0
1818

19-
- name: Setup Java
19+
- name: Set up JDK 17
2020
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
2121
with:
22-
distribution: 'corretto'
23-
java-version: 17
24-
25-
- name: Set up Apache Maven
26-
uses: actions/setup-java@v3
27-
with:
28-
distribution: 'corretto'
22+
distribution: 'adopt'
2923
java-version: '17'
30-
cache: 'maven'
3124

32-
- name: Build with Maven
33-
run: mvn clean install
25+
- name: Cache Maven packages
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.m2/repository
29+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: |
31+
${{ runner.os }}-maven-
3432
35-
- name: Copy dependencies
36-
run: mvn dependency:copy-dependencies
33+
- name: Build and test with Maven
34+
run: mvn clean org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent verify org.jacoco:jacoco-maven-plugin:0.8.8:report org.jacoco:jacoco-maven-plugin:0.8.8:report-aggregate -B
3735

3836
- name: SonarCloud Scan
39-
uses: sonarsource/sonarcloud-github-action@e44258b109568baa0df60ed515909fc6c72cba92 #v2.3.0
4037
env:
41-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4238
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43-
with:
44-
args: >
45-
-Dsonar.organization=${{ vars.SONARCLOUD_ORG }}
46-
-Dsonar.projectKey=${{ vars.SONARCLOUD_PROJECT_KEY }}
47-
-Dsonar.projectName="${{ vars.SONARCLOUD_PROJECT_NAME }}"
48-
-Dsonar.java.binaries=target/classes
49-
-Dsonar.java.libraries=target/dependency/*.jar
50-
-Dsonar.exclusions=**/enums/**,**/model/**,**/stub/**,**/dto/**,**/*Constant*,**/*Config.java,**/*Scheduler.java,**/*Application.java,**/src/test/**,**/Dummy*.java
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
run: |
41+
mvn sonar:sonar \
42+
-Dsonar.projectKey=${{ vars.SONARCLOUD_PROJECT_KEY }} \
43+
-Dsonar.organization=${{ vars.SONARCLOUD_ORG }} \
44+
-Dsonar.host.url=https://sonarcloud.io \
45+
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \
46+
-Dsonar.java.binaries=target/classes \
47+
-Dsonar.junit.reportPaths=target/surefire-reports \
48+
-Dsonar.jacoco.reportPaths=target/jacoco.exec \
49+
-Dsonar.exclusions=**/enums/**,**/model/**,**/stub/**,**/dto/**,**/*Constant*,**/*Config.java,**/*Scheduler.java,**/*Application.java,**/src/test/**,**/Dummy*.java

src/main/java/it/gov/pagopa/message/core/controller/CitizenController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public interface CitizenController {
1919
* @return outcome of the removal
2020
*/
2121
@DeleteMapping("/citizenConsents")
22-
ResponseEntity<CitizenConsentDTO> deleteCitizenConsent(@Valid @RequestBody CitizenConsentDTO citizenConsentDTO);
22+
ResponseEntity<CitizenConsentDTO> deleteCitizenConsents(@Valid @RequestBody CitizenConsentDTO citizenConsentDTO);
2323

2424
/**
2525
* Send message

src/main/java/it/gov/pagopa/message/core/controller/CitizenControllerImpl.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public CitizenControllerImpl(CitizenServiceImpl citizenService) {
1919

2020

2121
@Override
22-
public ResponseEntity<CitizenConsentDTO> deleteCitizenConsent(CitizenConsentDTO citizenConsentDTO) {
22+
public ResponseEntity<CitizenConsentDTO> deleteCitizenConsents(CitizenConsentDTO citizenConsentDTO) {
2323
citizenConsentDTO = citizenService.deleteCitizenConsent(citizenConsentDTO.getHashedFiscalCode(), citizenConsentDTO.getChannelId());
2424
return new ResponseEntity<>(citizenConsentDTO, HttpStatus.OK);
2525
}

src/main/java/it/gov/pagopa/message/core/service/SendMessageServiceImpl.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ private TokenDTO getToken(String authenticationUrl, String recipientId) throws E
5151
headers.set("RequestId", "00000000-0000-0000-0000-000000000006");
5252
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
5353

54-
String clientSecret = "64b5f14d-56ef-4d14-8b65-ff7bc5d4661e";
54+
String client = "64b5f14d-56ef-4d14-8b65-ff7bc5d4661e";
5555
String clientId = "6010064c-ec73-4fa5-9ed5-5446af8920cf";
5656
String grantType = "client_credentials";
5757
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
58-
map.add("client_secret", clientSecret);
58+
map.add("client_secret", client);
5959
map.add("client_id", clientId);
6060
map.add("grant_type", grantType);
6161
map.add("fiscal_code", recipientId);

0 commit comments

Comments
 (0)