Skip to content

Commit

Permalink
fix: updated datasafe-test-storage Test File
Browse files Browse the repository at this point in the history
  • Loading branch information
AssahBismarkabah committed Apr 11, 2024
1 parent bc9e2b4 commit e83665a
Show file tree
Hide file tree
Showing 22 changed files with 90 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import de.adorsys.datasafe.privatestore.api.actions.RemoveFromPrivate;
import de.adorsys.datasafe.privatestore.api.actions.WriteToPrivate;
import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.ListRequest;
import de.adorsys.datasafe.types.api.actions.ReadRequest;
import de.adorsys.datasafe.types.api.actions.RemoveRequest;
Expand Down Expand Up @@ -52,7 +52,7 @@

@Slf4j
@RequiredArgsConstructor
public abstract class BaseE2ETest extends WithStorageProvider {
public abstract class BaseE2ETest extends WithStorageProviderIT {

protected static final String PRIVATE_COMPONENT = "private";
protected static final String PRIVATE_FILES_COMPONENT = PRIVATE_COMPONENT + "/files";
Expand Down Expand Up @@ -252,7 +252,7 @@ protected void assertInboxSpaceList(UserIDAuth user, String root, String... expe
}

@SneakyThrows
protected void assertRootDirIsEmpty(WithStorageProvider.StorageDescriptor descriptor) {
protected void assertRootDirIsEmpty(WithStorageProviderIT.StorageDescriptor descriptor) {
try (Stream<AbsoluteLocation<ResolvedResource>> ls = descriptor.getStorageService().get()
.list(
new AbsoluteLocation<>(BasePrivateResource.forPrivate(descriptor.getLocation())))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import de.adorsys.datasafe.encrypiton.api.types.UserID;
import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth;
import de.adorsys.datasafe.storage.api.StorageService;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.ListRequest;
import de.adorsys.datasafe.types.api.actions.ReadRequest;
import de.adorsys.datasafe.types.api.actions.RemoveRequest;
Expand Down Expand Up @@ -65,7 +65,7 @@ class BasicFunctionalityTest extends BaseE2ETest {
@SneakyThrows
@ParameterizedTest
@MethodSource("fsOnly")
void testDFSPasswordClearance(WithStorageProvider.StorageDescriptor descriptor) {
void testDFSPasswordClearance(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);
UserID userJohn = new UserID("john");
assertThat(profileRetrievalService.userExists(userJohn)).isFalse();
Expand Down Expand Up @@ -154,7 +154,7 @@ void testDFSPasswordClearance(WithStorageProvider.StorageDescriptor descriptor)

@ParameterizedTest
@MethodSource("allStorages")
void testDFSBasedProfileStorage(WithStorageProvider.StorageDescriptor descriptor) {
void testDFSBasedProfileStorage(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);
UserID userJohn = new UserID("john");
assertThat(profileRetrievalService.userExists(userJohn)).isFalse();
Expand All @@ -173,7 +173,7 @@ void testDFSBasedProfileStorage(WithStorageProvider.StorageDescriptor descriptor
@SneakyThrows
@ParameterizedTest
@MethodSource("fsOnly")
void testUserIsRemovedWithFiles(WithStorageProvider.StorageDescriptor descriptor) {
void testUserIsRemovedWithFiles(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);
UserID userJohn = new UserID("john");
john = registerUser(userJohn.getValue());
Expand All @@ -191,7 +191,7 @@ void testUserIsRemovedWithFiles(WithStorageProvider.StorageDescriptor descriptor
@SneakyThrows
@ParameterizedTest
@MethodSource("allStorages")
void testMultipleRecipientsSharing(WithStorageProvider.StorageDescriptor descriptor) {
void testMultipleRecipientsSharing(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

UserIDAuth john = registerUser("john");
Expand All @@ -214,7 +214,7 @@ void testMultipleRecipientsSharing(WithStorageProvider.StorageDescriptor descrip
@SneakyThrows
@ParameterizedTest
@MethodSource("allStorages")
void testMultipleRecipientsSharingLargeChunk(WithStorageProvider.StorageDescriptor descriptor) {
void testMultipleRecipientsSharingLargeChunk(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

UserIDAuth john = registerUser("john");
Expand Down Expand Up @@ -242,7 +242,7 @@ void testMultipleRecipientsSharingLargeChunk(WithStorageProvider.StorageDescript
@ParameterizedTest
@MethodSource("allStorages")
void testWriteToPrivateListPrivateReadPrivateAndSendToAndReadFromInbox(
WithStorageProvider.StorageDescriptor descriptor) {
WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand Down Expand Up @@ -273,7 +273,7 @@ void testWriteToPrivateListPrivateReadPrivateAndSendToAndReadFromInbox(

@ParameterizedTest
@MethodSource("allStorages")
void listingValidation(WithStorageProvider.StorageDescriptor descriptor) {
void listingValidation(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand Down Expand Up @@ -303,7 +303,7 @@ void listingValidation(WithStorageProvider.StorageDescriptor descriptor) {

@ParameterizedTest
@MethodSource("allStorages")
void listingInboxValidation(WithStorageProvider.StorageDescriptor descriptor) {
void listingInboxValidation(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand Down Expand Up @@ -372,7 +372,7 @@ private List<AbsoluteLocation<ResolvedResource>> listFiles(Predicate<String> pat
}
}

private void init(WithStorageProvider.StorageDescriptor descriptor) {
private void init(WithStorageProviderIT.StorageDescriptor descriptor) {
DefaultDatasafeServices datasafeServices = DatasafeServicesProvider
.defaultDatasafeServices(descriptor.getStorageService().get(), descriptor.getLocation());
initialize(DatasafeServicesProvider.dfsConfig(descriptor.getLocation()), datasafeServices);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.adorsys.datasafe.business.impl.e2e;

import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
import de.adorsys.datasafe.types.api.resource.BasePrivateResource;
import de.adorsys.datasafe.types.api.resource.ResolvedResource;
Expand All @@ -24,7 +24,7 @@ class BasicFunctionalityUtf8Test extends BaseE2ETest {

@ParameterizedTest
@MethodSource("allStorages")
void readPrivateContentWithUnicode(WithStorageProvider.StorageDescriptor descriptor) {
void readPrivateContentWithUnicode(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

jane = registerUser("jane");
Expand All @@ -41,7 +41,7 @@ void readPrivateContentWithUnicode(WithStorageProvider.StorageDescriptor descrip

@ParameterizedTest
@MethodSource("allStorages")
void readPrivateContentWithUnicodeUsingUnicodePath(WithStorageProvider.StorageDescriptor descriptor) {
void readPrivateContentWithUnicodeUsingUnicodePath(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

jane = registerUser("jane");
Expand All @@ -59,7 +59,7 @@ void readPrivateContentWithUnicodeUsingUnicodePath(WithStorageProvider.StorageDe

@ParameterizedTest
@MethodSource("allStorages")
void listingPrivatePathWithUnicode(WithStorageProvider.StorageDescriptor descriptor) {
void listingPrivatePathWithUnicode(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand All @@ -83,7 +83,7 @@ void listingPrivatePathWithUnicode(WithStorageProvider.StorageDescriptor descrip

@ParameterizedTest
@MethodSource("allStorages")
void readInboxContentWithUnicodeUsingUnicodePath(WithStorageProvider.StorageDescriptor descriptor) {
void readInboxContentWithUnicodeUsingUnicodePath(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

jane = registerUser("jane");
Expand All @@ -102,7 +102,7 @@ void readInboxContentWithUnicodeUsingUnicodePath(WithStorageProvider.StorageDesc

@ParameterizedTest
@MethodSource("allStorages")
void listingInboxPathWithUnicode(WithStorageProvider.StorageDescriptor descriptor) {
void listingInboxPathWithUnicode(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices;
import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth;
import de.adorsys.datasafe.storage.api.StorageService;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.ReadRequest;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
Expand Down Expand Up @@ -56,7 +56,7 @@
* Multithreaded test of basic operations.
*/
@Slf4j
class BasicFunctionalityWithConcurrencyTest extends BaseE2ETest {
class BasicFunctionalityWithConcurrencyTestIT extends BaseE2ETest {

private static final int TIMEOUT_S = 30;

Expand Down Expand Up @@ -98,7 +98,7 @@ class BasicFunctionalityWithConcurrencyTest extends BaseE2ETest {
@SneakyThrows
@ParameterizedTest(name = "Run #{index} service storage: {0} with data size: {1} bytes and {2} threads.")
@MethodSource("differentThreadsTestOptions")
void writeToPrivateListPrivateInDifferentThreads(WithStorageProvider.StorageDescriptor descriptor, int size, int poolSize) {
void writeToPrivateListPrivateInDifferentThreads(WithStorageProviderIT.StorageDescriptor descriptor, int size, int poolSize) {
init(descriptor);

Path testFile = tempTestFileFolder.resolve(UUID.randomUUID().toString());
Expand Down Expand Up @@ -287,7 +287,7 @@ protected static Stream<Arguments> differentThreadsTestOptions() {
return arguments.stream();
}

private void init(WithStorageProvider.StorageDescriptor descriptor) {
private void init(WithStorageProviderIT.StorageDescriptor descriptor) {
DefaultDatasafeServices datasafeServices = DatasafeServicesProvider
.defaultDatasafeServices(descriptor.getStorageService().get(), descriptor.getLocation());
initialize(DatasafeServicesProvider.dfsConfig(descriptor.getLocation()), datasafeServices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices;
import de.adorsys.datasafe.encrypiton.api.types.UserID;
import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.ReadRequest;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
Expand All @@ -28,12 +28,12 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

class BasicFunctionalityWithPasswordChangeTest extends BaseE2ETest {
class BasicFunctionalityWithPasswordChangeTestIT extends BaseE2ETest {

@SneakyThrows
@ParameterizedTest
@MethodSource("allStorages")
void testUserIsRemovedWithFiles(WithStorageProvider.StorageDescriptor descriptor) {
void testUserIsRemovedWithFiles(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);
UserID userJohn = new UserID("john");
john = registerUser(userJohn.getValue());
Expand All @@ -57,7 +57,7 @@ void testUserIsRemovedWithFiles(WithStorageProvider.StorageDescriptor descriptor
@SneakyThrows
@ParameterizedTest
@MethodSource("allStorages")
void testMultipleRecipientsSharing(WithStorageProvider.StorageDescriptor descriptor) {
void testMultipleRecipientsSharing(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

UserIDAuth john = registerUser("john");
Expand All @@ -79,7 +79,7 @@ void testMultipleRecipientsSharing(WithStorageProvider.StorageDescriptor descrip
@ParameterizedTest
@MethodSource("allStorages")
void testWriteToPrivateListPrivateReadPrivateAndSendToAndReadFromInbox(
WithStorageProvider.StorageDescriptor descriptor) {
WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand Down Expand Up @@ -124,7 +124,7 @@ void testWriteToPrivateListPrivateReadPrivateAndSendToAndReadFromInbox(

@ParameterizedTest
@MethodSource("allStorages")
void listingValidation(WithStorageProvider.StorageDescriptor descriptor) {
void listingValidation(WithStorageProviderIT.StorageDescriptor descriptor) {
init(descriptor);

registerJohnAndJane();
Expand Down Expand Up @@ -207,7 +207,7 @@ private UserIDAuth checkUpdatedCredsWorkAndOldDont(UserIDAuth auth,
return newAuth;
}

private void init(WithStorageProvider.StorageDescriptor descriptor) {
private void init(WithStorageProviderIT.StorageDescriptor descriptor) {
DefaultDatasafeServices datasafeServices = DatasafeServicesProvider
.defaultDatasafeServices(descriptor.getStorageService().get(), descriptor.getLocation());
initialize(DatasafeServicesProvider.dfsConfig(descriptor.getLocation()), datasafeServices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import de.adorsys.datasafe.directory.impl.profile.config.DefaultDFSConfig;
import de.adorsys.datasafe.encrypiton.api.types.UserID;
import de.adorsys.datasafe.encrypiton.api.types.encryption.EncryptionConfig;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.ReadRequest;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
import de.adorsys.datasafe.types.api.types.ReadStorePassword;
Expand All @@ -31,7 +31,7 @@ public class KeyStoreTypeCompareTest extends BaseE2ETest {
@SneakyThrows
@ParameterizedTest
@MethodSource("fsOnly")
void compareKeyStoreTypes(WithStorageProvider.StorageDescriptor descriptor) {
void compareKeyStoreTypes(WithStorageProviderIT.StorageDescriptor descriptor) {
long tUBER = test(descriptor, "johnUber", "UBER");
long tBCFKS = test(descriptor, "johnBCFKS", "BCFKS");
log.info("UBER test took: {}", tUBER);
Expand All @@ -42,7 +42,7 @@ void compareKeyStoreTypes(WithStorageProvider.StorageDescriptor descriptor) {


@SneakyThrows
long test(WithStorageProvider.StorageDescriptor descriptor, String userName, String keystoreType) {
long test(WithStorageProviderIT.StorageDescriptor descriptor, String userName, String keystoreType) {
init(descriptor, keystoreType);
UserID user = new UserID(userName);
assertThat(profileRetrievalService.userExists(user)).isFalse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import de.adorsys.datasafe.storage.api.SchemeDelegatingStorage;
import de.adorsys.datasafe.storage.api.StorageService;
import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
import de.adorsys.datasafe.types.api.resource.BasePrivateResource;
Expand All @@ -32,7 +32,7 @@

import static org.assertj.core.api.Assertions.assertThat;

class SchemeDelegationTest extends WithStorageProvider {
class SchemeDelegationTest extends WithStorageProviderIT {

private Path fsPath;
private Uri minioPath;
Expand All @@ -42,7 +42,7 @@ class SchemeDelegationTest extends WithStorageProvider {

@BeforeEach
void initialize(@TempDir Path tempDir) {
WithStorageProvider.StorageDescriptor minioDescriptor = minio();
WithStorageProviderIT.StorageDescriptor minioDescriptor = minio();
this.fsPath = tempDir;
this.minio = minioDescriptor.getStorageService().get();
this.filesystem = new FileSystemStorageService(tempDir);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import de.adorsys.datasafe.storage.impl.db.DatabaseCredentials;
import de.adorsys.datasafe.storage.impl.db.DatabaseStorageService;
import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
import de.adorsys.datasafe.types.api.resource.BasePrivateResource;
Expand All @@ -38,7 +38,7 @@
import static de.adorsys.datasafe.types.api.global.PathEncryptionId.AES_SIV;
import static org.assertj.core.api.Assertions.assertThat;

class SchemeDelegationWithDbTest extends WithStorageProvider {
class SchemeDelegationWithDbTestIT extends WithStorageProviderIT {

private static final Set<String> ALLOWED_TABLES = ImmutableSet.of("users", "private_profiles", "public_profiles");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.google.common.io.ByteStreams;
import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices;
import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.ReadRequest;
import de.adorsys.datasafe.types.api.actions.RemoveRequest;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
Expand All @@ -24,8 +24,8 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

@DisabledIfSystemProperty(named = WithStorageProvider.SKIP_CEPH, matches = "true")
class StorageBasedVersioningTest extends BaseE2ETest {
@DisabledIfSystemProperty(named = WithStorageProviderIT.SKIP_CEPH, matches = "true")
class StorageBasedVersioningTestIT extends BaseE2ETest {

private static final String FILE = "file.txt";

Expand Down Expand Up @@ -107,7 +107,7 @@ private String readByVersion(UserIDAuth user, String path, StorageVersion versio
return new String(os.toByteArray(), StandardCharsets.UTF_8);
}

private void init(WithStorageProvider.StorageDescriptor descriptor) {
private void init(WithStorageProviderIT.StorageDescriptor descriptor) {
DefaultDatasafeServices datasafeServices = DatasafeServicesProvider
.defaultDatasafeServices(descriptor.getStorageService().get(), descriptor.getLocation());
initialize(DatasafeServicesProvider.dfsConfig(descriptor.getLocation()), datasafeServices);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import de.adorsys.datasafe.storage.api.SchemeDelegatingStorage;
import de.adorsys.datasafe.storage.api.StorageService;
import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService;
import de.adorsys.datasafe.teststorage.WithStorageProvider;
import de.adorsys.datasafe.teststorage.WithStorageProviderIT;
import de.adorsys.datasafe.types.api.actions.WriteRequest;
import de.adorsys.datasafe.types.api.resource.AbsoluteLocation;
import de.adorsys.datasafe.types.api.resource.BasePrivateResource;
Expand All @@ -32,7 +32,7 @@
import static de.adorsys.datasafe.types.api.shared.Dirs.computeRelativePreventingDoubleUrlEncode;
import static org.assertj.core.api.Assertions.assertThat;

class UserProfileWithUtf8Test extends WithStorageProvider {
class UserProfileWithUtf8TestIT extends WithStorageProviderIT {

private Path fsPath;
private Uri minioPath;
Expand Down
Loading

0 comments on commit e83665a

Please sign in to comment.