Skip to content

Commit

Permalink
Refactoring/Improving source: artifactory-fs (#1606)
Browse files Browse the repository at this point in the history
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
  • Loading branch information
avgustinmm committed Feb 3, 2024
1 parent f8b1910 commit d388b8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,19 @@
*/
package org.eclipse.hawkbit.artifact.repository;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
* Configuration properties for the file-system repository, e.g. the base-path
* to store the files.
*/
@Data
@ConfigurationProperties("org.eclipse.hawkbit.repository.file")
public class ArtifactFilesystemProperties {

/**
* The base-path of the directory to store the artifacts.
*/
private String path = "./artifactrepo";

public String getPath() {
return path;
}

public void setPath(final String path) {
this.path = path;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,23 @@
import java.nio.file.Files;
import java.util.Random;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.assertj.core.api.Assertions;
import org.eclipse.hawkbit.artifact.repository.model.AbstractDbArtifact;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import io.qameta.allure.Description;
import io.qameta.allure.Feature;
import io.qameta.allure.Story;

@Slf4j
@Feature("Unit Tests - Artifact File System Repository")
@Story("Test storing artifact binaries in the file-system")
public class ArtifactFilesystemRepositoryTest {
private static final Logger LOG = LoggerFactory.getLogger(ArtifactFilesystemRepositoryTest.class);

private static final String TENANT = "test_tenant";

Expand All @@ -56,7 +55,7 @@ public static void afterClass() {
try {
FileUtils.deleteDirectory(new File(artifactResourceProperties.getPath()));
} catch (final IOException | IllegalArgumentException e) {
LOG.warn("Cannot delete file-directory", e);
log.warn("Cannot delete file-directory", e);
}
}
}
Expand Down

0 comments on commit d388b8a

Please sign in to comment.