Fix SonarQube issues (2) (#2205)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-01-20 16:29:45 +02:00
committed by GitHub
parent 385023d8b6
commit 5dabe9117a
33 changed files with 162 additions and 185 deletions

View File

@@ -18,12 +18,14 @@ import java.util.Objects;
import jakarta.validation.constraints.NotNull;
import lombok.EqualsAndHashCode;
import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact;
import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash;
/**
* {@link AbstractDbArtifact} implementation which dynamically creates a {@link FileInputStream} on calling {@link #getFileInputStream()}.
*/
@EqualsAndHashCode(callSuper = true)
public class ArtifactFilesystem extends AbstractDbArtifact {
private final File file;

View File

@@ -49,6 +49,6 @@ class ArtifactFilesystemTest {
final ArtifactFilesystem underTest = new ArtifactFilesystem(
createTempFile, ArtifactFilesystemTest.class.getSimpleName(), new DbArtifactHash("1", "2", "3"), 0L, null);
final byte[] buffer = new byte[1024];
assertThat(IOUtils.read(underTest.getFileInputStream(), buffer)).isEqualTo(0);
assertThat(IOUtils.read(underTest.getFileInputStream(), buffer)).isZero();
}
}