diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d5f907a..1d065b9 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,7 +36,7 @@ jobs: run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=DiSSCo_${{ github.event.repository.name }} -Dsonar.exclusions=**/jooq/** - -Dsonar.coverage.exclusions=**/properties/**,**/configuration/** + -Dsonar.coverage.exclusions=**/properties/**,**/configuration/**,**/domain/**,**/exception/** - name: Login to Public ECR if: github.event_name != 'pull_request' uses: docker/login-action@v1 diff --git a/src/main/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepository.java b/src/main/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepository.java index 6223f93..67d01dc 100644 --- a/src/main/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepository.java +++ b/src/main/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepository.java @@ -9,7 +9,6 @@ import java.time.Instant; import java.util.Collection; import java.util.List; -import java.util.Optional; import lombok.RequiredArgsConstructor; import org.jooq.DSLContext; import org.jooq.JSONB; @@ -49,7 +48,8 @@ private DigitalSpecimenRecord mapDigitalSpecimen(Record dbRecord) { digitalSpecimen); } - public int[] createDigitalSpecimenRecord(Collection digitalSpecimenRecords) { + public int[] createDigitalSpecimenRecord( + Collection digitalSpecimenRecords) { var queries = digitalSpecimenRecords.stream().map(this::specimenToQuery).toList(); return context.batch(queries).execute(); } diff --git a/src/test/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepositoryIT.java b/src/test/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepositoryIT.java index ddf67a4..383c280 100644 --- a/src/test/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepositoryIT.java +++ b/src/test/java/eu/dissco/core/digitalspecimenprocessor/repository/DigitalSpecimenRepositoryIT.java @@ -74,9 +74,10 @@ void testUpdateVersionSpecimens() { givenDigitalSpecimenRecord("20.5000.1025/YYY-YYY-YYY", "TEST_2"))); // When - repository.createDigitalSpecimenRecord(List.of(givenDigitalSpecimenRecord(2))); + var result = repository.createDigitalSpecimenRecord(List.of(givenDigitalSpecimenRecord(2))); // Then + assertThat(result).isEqualTo(new int[]{1}); } @Test