mirror of
https://github.com/valitydev/file-storage.git
synced 2024-11-06 00:35:22 +00:00
parent
7fce7c6a57
commit
ccdaffe109
22
pom.xml
22
pom.xml
@ -30,7 +30,11 @@
|
||||
<dependency>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>file-storage-proto</artifactId>
|
||||
<version>1.33-86bcf44</version>
|
||||
<version>1.41-89c2d94</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.vality</groupId>
|
||||
<artifactId>damsel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>dev.vality.woody</groupId>
|
||||
@ -144,22 +148,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<argLine>-Dfile.encoding=UTF-8</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>p12</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-remote-resources-plugin</artifactId>
|
||||
|
@ -1,10 +1,10 @@
|
||||
package dev.vality.file.storage.handler;
|
||||
|
||||
import dev.vality.damsel.msgpack.Value;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.FileNotFound;
|
||||
import dev.vality.file.storage.FileStorageSrv;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.service.StorageService;
|
||||
import dev.vality.file.storage.service.exception.FileNotFoundException;
|
||||
import dev.vality.file.storage.service.exception.StorageException;
|
||||
|
@ -6,10 +6,10 @@ import com.amazonaws.services.s3.AmazonS3;
|
||||
import com.amazonaws.services.s3.model.*;
|
||||
import com.amazonaws.services.s3.transfer.TransferManager;
|
||||
import com.amazonaws.services.s3.transfer.Upload;
|
||||
import dev.vality.damsel.msgpack.Value;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.configuration.properties.S3Properties;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.service.exception.ExtractMetadataException;
|
||||
import dev.vality.file.storage.service.exception.FileNotFoundException;
|
||||
import dev.vality.file.storage.service.exception.StorageException;
|
||||
|
@ -1,9 +1,9 @@
|
||||
package dev.vality.file.storage.service;
|
||||
|
||||
import dev.vality.damsel.msgpack.Value;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.configuration.properties.S3SdkV2Properties;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
import dev.vality.file.storage.service.exception.FileNotFoundException;
|
||||
import dev.vality.file.storage.service.exception.StorageException;
|
||||
import dev.vality.file.storage.util.DamselUtil;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package dev.vality.file.storage.service;
|
||||
|
||||
import dev.vality.damsel.msgpack.Value;
|
||||
import dev.vality.file.storage.FileData;
|
||||
import dev.vality.file.storage.NewFileResult;
|
||||
import dev.vality.file.storage.msgpack.Value;
|
||||
|
||||
import java.net.URL;
|
||||
import java.time.Instant;
|
||||
|
@ -30,7 +30,7 @@ import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import static dev.vality.file.storage.msgpack.Value.*;
|
||||
import static dev.vality.damsel.msgpack.Value.*;
|
||||
import static dev.vality.testcontainers.annotations.util.ValuesGenerator.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@ -59,9 +59,9 @@ public abstract class FileStorageTest {
|
||||
@Test
|
||||
public void fileUploadWithHttpClientBuilderTest() throws IOException, URISyntaxException, TException {
|
||||
String expirationTime = generateCurrentTimePlusDay().toString();
|
||||
Map<String, dev.vality.file.storage.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", dev.vality.file.storage.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", dev.vality.file.storage.msgpack.Value.str("1.0.0.0"));
|
||||
Map<String, dev.vality.damsel.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", dev.vality.damsel.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", dev.vality.damsel.msgpack.Value.str("1.0.0.0"));
|
||||
|
||||
NewFileResult fileResult = fileStorageClient.createNewFile(metadata, expirationTime);
|
||||
|
||||
@ -94,9 +94,9 @@ public abstract class FileStorageTest {
|
||||
try {
|
||||
// создание нового файла
|
||||
String expirationTime = generateCurrentTimePlusDay().toString();
|
||||
Map<String, dev.vality.file.storage.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", dev.vality.file.storage.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", dev.vality.file.storage.msgpack.Value.str("1.0.0.0"));
|
||||
Map<String, dev.vality.damsel.msgpack.Value> metadata = new HashMap<>();
|
||||
metadata.put("author", dev.vality.damsel.msgpack.Value.str("Mary Doe"));
|
||||
metadata.put("version", dev.vality.damsel.msgpack.Value.str("1.0.0.0"));
|
||||
NewFileResult fileResult = fileStorageClient.createNewFile(metadata, expirationTime);
|
||||
uploadTestData(fileResult, FILE_NAME, FILE_DATA);
|
||||
|
||||
|
@ -6,5 +6,5 @@ import dev.vality.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
@CephTestcontainerSingleton(
|
||||
properties = {"s3-sdk-v2.enabled=true", "s3-sdk-v2.region=us-east-1"},
|
||||
bucketName = "awssdks3v2")
|
||||
public class WithCeph extends FileStorageTest {
|
||||
public class WithCephTest extends FileStorageTest {
|
||||
}
|
@ -6,5 +6,5 @@ import dev.vality.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
@MinioTestcontainerSingleton(
|
||||
properties = "s3-sdk-v2.enabled=true",
|
||||
bucketName = "awssdks3v2")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
public class WithMinioTest extends FileStorageTest {
|
||||
}
|
@ -4,5 +4,5 @@ import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
|
||||
@CephTestcontainerSingleton(bucketName = "s3signer")
|
||||
public class WithCeph extends FileStorageTest {
|
||||
public class WithCephTest extends FileStorageTest {
|
||||
}
|
@ -4,5 +4,5 @@ import dev.vality.file.storage.FileStorageTest;
|
||||
import dev.vality.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
|
||||
@MinioTestcontainerSingleton(bucketName = "s3signer")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
public class WithMinioTest extends FileStorageTest {
|
||||
}
|
@ -6,5 +6,5 @@ import dev.vality.testcontainers.annotations.ceph.CephTestcontainerSingleton;
|
||||
@CephTestcontainerSingleton(
|
||||
properties = "s3.signer-override=AWSS3V4SignerType",
|
||||
bucketName = "s3v4signer")
|
||||
public class WithCeph extends FileStorageTest {
|
||||
public class WithCephTest extends FileStorageTest {
|
||||
}
|
@ -6,5 +6,5 @@ import dev.vality.testcontainers.annotations.minio.MinioTestcontainerSingleton;
|
||||
@MinioTestcontainerSingleton(
|
||||
properties = "s3.signer-override=AWSS3V4SignerType",
|
||||
bucketName = "s3v4signer")
|
||||
public class WithMinio extends FileStorageTest {
|
||||
public class WithMinioTest extends FileStorageTest {
|
||||
}
|
22
src/test/resources/logback-test.xml
Normal file
22
src/test/resources/logback-test.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
|
||||
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
|
||||
<logger name="org.apache.http">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.amazonaws">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
<logger name="dev.vality.woody">
|
||||
<level value="error"/>
|
||||
</logger>
|
||||
|
||||
</configuration>
|
Loading…
Reference in New Issue
Block a user