Remove allure (phase2) (#2483)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-06-20 15:51:06 +03:00
committed by GitHub
parent 39593fc6b6
commit cb7f1107fe
406 changed files with 6993 additions and 5863 deletions

View File

@@ -16,9 +16,6 @@ import java.io.File;
import java.io.IOException;
import java.util.Random;
import io.qameta.allure.Description;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -29,8 +26,10 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@Slf4j
@Feature("Unit Tests - Artifact File System Repository")
@Story("Test storing artifact binaries in the file-system")
/**
* Feature: Unit Tests - Artifact File System Repository<br/>
* Story: Test storing artifact binaries in the file-system
*/
class ArtifactFilesystemRepositoryTest {
private static final String TENANT = "test_tenant";
@@ -57,9 +56,10 @@ class ArtifactFilesystemRepositoryTest {
}
}
@Test
@Description("Verifies that an artifact can be successfully stored in the file-system repository")
void storeSuccessfully() throws IOException {
/**
* Verifies that an artifact can be successfully stored in the file-system repository
*/
@Test void storeSuccessfully() throws IOException {
final byte[] fileContent = randomBytes();
final AbstractDbArtifact artifact = storeRandomArtifact(fileContent);
@@ -68,36 +68,40 @@ class ArtifactFilesystemRepositoryTest {
assertThat(readContent).isEqualTo(fileContent);
}
@Test
@Description("Verifies that an artifact can be successfully stored in the file-system repository")
void getStoredArtifactBasedOnSHA1Hash() throws IOException {
/**
* Verifies that an artifact can be successfully stored in the file-system repository
*/
@Test void getStoredArtifactBasedOnSHA1Hash() throws IOException {
final byte[] fileContent = randomBytes();
final AbstractDbArtifact artifact = storeRandomArtifact(fileContent);
assertThat(artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1())).isNotNull();
}
@Test
@Description("Verifies that an artifact can be deleted in the file-system repository")
void deleteStoredArtifactBySHA1Hash() throws IOException {
/**
* Verifies that an artifact can be deleted in the file-system repository
*/
@Test void deleteStoredArtifactBySHA1Hash() throws IOException {
final AbstractDbArtifact artifact = storeRandomArtifact(randomBytes());
artifactFilesystemRepository.deleteBySha1(TENANT, artifact.getHashes().getSha1());
assertThat(artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1())).isNull();
}
@Test
@Description("Verifies that all artifacts of a tenant can be deleted in the file-system repository")
void deleteStoredArtifactOfTenant() throws IOException {
/**
* Verifies that all artifacts of a tenant can be deleted in the file-system repository
*/
@Test void deleteStoredArtifactOfTenant() throws IOException {
final AbstractDbArtifact artifact = storeRandomArtifact(randomBytes());
artifactFilesystemRepository.deleteByTenant(TENANT);
assertThat(artifactFilesystemRepository.getArtifactBySha1(TENANT, artifact.getHashes().getSha1())).isNull();
}
@Test
@Description("Verifies that an artifact which does not exists is deleted quietly in the file-system repository")
void deleteArtifactWhichDoesNotExistsBySHA1HashWithoutException() throws IOException {
/**
* Verifies that an artifact which does not exists is deleted quietly in the file-system repository
*/
@Test void deleteArtifactWhichDoesNotExistsBySHA1HashWithoutException() throws IOException {
try {
artifactFilesystemRepository.deleteBySha1(TENANT, "sha1HashWhichDoesNotExists");
} catch (final Exception e) {

View File

@@ -16,20 +16,20 @@ import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import io.qameta.allure.Description;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;
import org.apache.commons.io.IOUtils;
import org.eclipse.hawkbit.artifact.repository.model.DbArtifactHash;
import org.junit.jupiter.api.Test;
@Feature("Unit Tests - Artifact File System Repository")
@Story("Test storing artifact binaries in the file-system")
/**
* Feature: Unit Tests - Artifact File System Repository<br/>
* Story: Test storing artifact binaries in the file-system
*/
class ArtifactFilesystemTest {
@Test
@Description("Verifies that an exception is thrown on opening an InputStream when file does not exists")
void getInputStreamOfNonExistingFileThrowsException() {
/**
* Verifies that an exception is thrown on opening an InputStream when file does not exists
*/
@Test void getInputStreamOfNonExistingFileThrowsException() {
final File file = new File("fileWhichTotalDoesNotExists");
final ArtifactFilesystem underTest = new ArtifactFilesystem(
file, "fileWhichTotalDoesNotExists",
@@ -39,9 +39,10 @@ class ArtifactFilesystemTest {
.hasCauseInstanceOf(FileNotFoundException.class);
}
@Test
@Description("Verifies that an InputStream can be opened if file exists")
void getInputStreamOfExistingFile() throws IOException {
/**
* Verifies that an InputStream can be opened if file exists
*/
@Test void getInputStreamOfExistingFile() throws IOException {
final ArtifactFilesystem underTest = new ArtifactFilesystem(
AbstractArtifactRepository.createTempFile(false), ArtifactFilesystemTest.class.getSimpleName(),
new DbArtifactHash("1", "2", "3"), 0L, null);