Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Suppress/warnings #1885

Merged
merged 12 commits into from
Aug 22, 2022
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.common.federation.client;

public class CloudFeignHttpClientProviderException extends RuntimeException {
private static final long serialVersionUID = 8199713110526635715L;

public CloudFeignHttpClientProviderException(final Throwable cause) {
super(cause);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@

package app.coronawarn.server.common.federation.client.upload;


import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;

import org.junit.jupiter.api.Test;

class BatchUploadResponseTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@


package app.coronawarn.server.common.persistence.domain;

import java.time.LocalDate;
import java.util.Objects;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.PersistenceConstructor;
import org.springframework.data.annotation.PersistenceCreator;

/**
* Information about federation batches with their status.
Expand Down Expand Up @@ -36,7 +34,7 @@ public FederationBatchInfo(String batchTag, LocalDate date, FederationBatchSourc
* @param date date the batch was created
* @param status status stored as {@link FederationBatchStatus}
*/
@PersistenceConstructor
@PersistenceCreator
public FederationBatchInfo(String batchTag, LocalDate date, FederationBatchStatus status,
FederationBatchSourceSystem sourceSystem) {
this.batchTag = batchTag;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package app.coronawarn.server.common.persistence.exception;

/**
Expand All @@ -10,6 +8,7 @@
* is semantically erroneous.
*/
public class InvalidDiagnosisKeyException extends RuntimeException {
private static final long serialVersionUID = -6124348897420468935L;

public InvalidDiagnosisKeyException(String message) {
super(message);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package app.coronawarn.server.common.persistence.repository;


import app.coronawarn.server.common.persistence.domain.TraceTimeIntervalWarning;
import org.springframework.data.jdbc.repository.query.Modifying;
import org.springframework.data.jdbc.repository.query.Query;
Expand All @@ -12,7 +11,7 @@
* Event check-in repository.
* @deprecated in favor of encrypted check-ins.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
@Repository
public interface TraceTimeIntervalWarningRepository
extends PagingAndSortingRepository<TraceTimeIntervalWarning, Long> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@SuppressWarnings("deprecation")
@Component
public class TraceTimeIntervalWarningService {

private static final Logger logger =
LoggerFactory.getLogger(TraceTimeIntervalWarningService.class);

@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private final TraceTimeIntervalWarningRepository traceTimeIntervalWarningRepo;
private final CheckInProtectedReportsRepository checkInProtectedReportsRepository;
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private final MessageDigest hashAlgorithm;

/**
Expand All @@ -61,13 +62,13 @@ public TraceTimeIntervalWarningService(
*
* @deprecated in favor of encrypted checkins.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
@Transactional
public int saveCheckins(List<CheckIn> checkins, int submissionTimestamp, SubmissionType submissionType) {
return saveCheckins(checkins, this::hashLocationId, submissionTimestamp, submissionType);
}

@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private int saveCheckins(List<CheckIn> checkins, Function<ByteString, byte[]> idHashGenerator,
int submissionTimestamp, SubmissionType submissionType) {
int numberOfInsertedTraceWarnings = 0;
Expand Down Expand Up @@ -129,7 +130,7 @@ public int saveCheckInProtectedReports(List<CheckInProtectedReport> allCheckins,
*
* @deprecated because trace time warnings are not longer supported and replaced by encrypted checkins.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
public Collection<TraceTimeIntervalWarning> getTraceTimeIntervalWarnings() {
return StreamUtils
.createStreamFromIterator(traceTimeIntervalWarningRepo
Expand All @@ -147,7 +148,7 @@ public Collection<CheckInProtectedReports> getCheckInProtectedReports() {
.collect(Collectors.toList());
}

@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
private byte[] hashLocationId(ByteString locationId) {
return hashAlgorithm.digest(locationId.toByteArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@SuppressWarnings("removal")
@SuppressWarnings("deprecation")
@SpringBootApplication
@Configuration
public class TestApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@DataJdbcTest
class TraceTimeIntervalWarningRepositoryTest {

@SuppressWarnings("deprecation")
@Autowired
private TraceTimeIntervalWarningRepository underTest;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@


package app.coronawarn.server.common.persistence.service;

import static app.coronawarn.server.common.persistence.domain.FederationBatchSourceSystem.*;
import static app.coronawarn.server.common.persistence.domain.FederationBatchSourceSystem.EFGS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.catchThrowable;

import app.coronawarn.server.common.persistence.domain.FederationBatchInfo;
import app.coronawarn.server.common.persistence.domain.FederationBatchStatus;
import app.coronawarn.server.common.persistence.domain.FederationBatchSourceSystem;
import app.coronawarn.server.common.persistence.repository.FederationBatchInfoRepository;
import java.time.LocalDate;
import java.time.Period;
Expand All @@ -21,7 +18,6 @@
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.jdbc.DataJdbcTest;
import org.springframework.test.context.ActiveProfiles;

@DataJdbcTest
class FederationBatchInfoServiceTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package app.coronawarn.server.common.persistence.service;

import static app.coronawarn.server.common.persistence.service.DiagnosisKeyServiceTestHelper.assertDiagnosisKeysEqual;
Expand All @@ -22,7 +20,6 @@
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.autoconfigure.data.jdbc.DataJdbcTest;
import org.springframework.boot.test.mock.mockito.MockBean;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.springframework.boot.test.autoconfigure.data.jdbc.DataJdbcTest;
import org.testcontainers.shaded.org.bouncycastle.util.encoders.Hex;

@SuppressWarnings("deprecation")
@DataJdbcTest
class TraceTimeIntervalWarningServiceTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import app.coronawarn.server.common.persistence.domain.config.TekFieldDerivations;
import app.coronawarn.server.common.persistence.utils.YamlPropertySourceFactory;

@DataJdbcTest
@ExtendWith(MockitoExtension.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@


package app.coronawarn.server.common.shared.exception;

/**
* The file could not be loaded/parsed correctly.
*/
public class UnableToLoadFileException extends Exception {
private static final long serialVersionUID = 5554527058338857525L;

public UnableToLoadFileException(String path) {
super("Unable to load file from path " + path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.common.shared.functional;

public class CheckedFunctionAndConsumerException extends RuntimeException {
private static final long serialVersionUID = -7637713928805965646L;

public CheckedFunctionAndConsumerException(final Throwable cause) {
super(cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.springframework.security.core.AuthenticationException;

public class CertificateCnMismatchException extends AuthenticationException {
private static final long serialVersionUID = 5480042926779226129L;

public CertificateCnMismatchException(String msg) {
super(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.http.ResponseEntity;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, //
classes = {ServerApplication.class, ClientCertificateTestConfig.class})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app.coronawarn.server.services.callback.controller;

import static app.coronawarn.server.common.persistence.domain.FederationBatchSourceSystem.CHGS;
import static app.coronawarn.server.common.persistence.domain.FederationBatchSourceSystem.EFGS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.OK;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package app.coronawarn.server.services.distribution.assembly.appconfig.parsing;

import app.coronawarn.server.common.shared.exception.UnableToLoadFileException;
Expand All @@ -9,6 +7,7 @@
* This exception is raised in case SnakeYaml was not able to map the content of the include to the target data type.
*/
public class IncludeResolveFailedException extends RuntimeException {
private static final long serialVersionUID = -6510293265253711125L;

/**
* Creates a new Include Resolve Failed Exception.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package app.coronawarn.server.services.distribution.assembly.appconfig.parsing;

import org.yaml.snakeyaml.nodes.Node;
Expand All @@ -9,6 +7,7 @@
* should contain a Message Builder. This Message.Builder is required for the processing.
*/
public class NoMessageBuilderOnClassException extends RuntimeException {
private static final long serialVersionUID = 4867340635126780197L;

/**
* Creates a new exception instance based on the given {@link Node}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@


package app.coronawarn.server.services.distribution.assembly.appconfig.validation;

/**
* The validation could not be executed. Find more information about the root cause in the cause element, and in the
* message property.
*/
public class ValidationExecutionException extends RuntimeException {
private static final long serialVersionUID = -3970814945560559417L;

public ValidationExecutionException(String message, Throwable cause) {
super(message, cause);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


package app.coronawarn.server.services.distribution.assembly.component;

import app.coronawarn.server.services.distribution.assembly.structure.WritableOnDisk;
Expand Down Expand Up @@ -62,6 +60,7 @@ public class CwaApiStructureProvider {
*
* @return new instance of IndexingDecoratorOnDisk base directory
*/
@SuppressWarnings("deprecation")
public Directory<WritableOnDisk> getDirectory() {
IndexDirectoryOnDisk<String> versionDirectory = new IndexDirectoryOnDisk<>(
distributionServiceConfig.getApi().getVersionPath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class TraceTimeIntervalWarningsPackageBundler {
* @see CheckinsDateSpecification#HOUR_SINCE_EPOCH_DERIVATION
* @deprecated in favor of {@link #distributableCheckInProtectedReports}.
*/
@Deprecated(since = "2.8", forRemoval = true)
@Deprecated(since = "2.8", forRemoval = false)
protected final Map<Integer, List<TraceTimeIntervalWarning>> distributableTraceTimeIntervalWarnings =
new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("deprecation")
public class TraceTimeIntervalWarningsCountryDirectory extends IndexDirectoryOnDisk<String> {

private static final String VERSION_V2 = "v2";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.services.distribution.dcc;

public class FetchDccListException extends Exception {
private static final long serialVersionUID = -6658461155713651342L;

public FetchDccListException(String message, Throwable cause) {
super(message, cause);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package app.coronawarn.server.services.distribution.dcc.decode;

public class DccRevocationListDecodeException extends Exception {
private static final long serialVersionUID = 773876244555365963L;

public DccRevocationListDecodeException(String message, Throwable cause) {
super(message, cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Component;


@Component
public class DigitalGreenCertificateToProtobufMapping {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.services.distribution.dgc.dsc.errors;

public class InvalidContentResponseException extends Exception {
private static final long serialVersionUID = -4419103572626924400L;
private static final String ERROR = "Obtaining providers from content response failed";

public InvalidContentResponseException() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.services.distribution.dgc.dsc.errors;

public class InvalidFingerprintException extends Exception {
private static final long serialVersionUID = 5715798235468337392L;
private static final String ERROR = "Obtaining service provider allow list failed";

public InvalidFingerprintException() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package app.coronawarn.server.services.distribution.dgc.exception;

public class DigitalCovidCertificateSignatureException extends RuntimeException {
private static final long serialVersionUID = -8753378064860398366L;

public DigitalCovidCertificateSignatureException(String message, Throwable cause) {
super(message, cause);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.services.distribution.dgc.exception;

public class DscListDecodeException extends Exception {
private static final long serialVersionUID = 3606460668598764440L;

public DscListDecodeException(String message, Throwable cause) {
super(message, cause);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app.coronawarn.server.services.distribution.dgc.exception;

public class FetchDscTrustListException extends Exception {
private static final long serialVersionUID = 4730807672445241054L;

public FetchDscTrustListException(String message) {
super(message);
Expand Down
Loading