Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import static org.awaitility.Awaitility.await;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import java.io.File;
import java.util.List;
Expand All @@ -43,6 +44,8 @@
import androidx.test.filters.Suppress;
import androidx.test.platform.app.InstrumentationRegistry;

import io.reactivex.Completable;

@RunWith(AndroidJUnit4.class)
public class UtilsHandlerTest {

Expand Down Expand Up @@ -120,18 +123,19 @@ public void testRepeatedSaveBookmarkShouldNeverThrowException() {
private void performEncryptUriTest(@NonNull final String origPath) {
String encryptedPath = NetCopyClientUtils.INSTANCE.encryptFtpPathAsNecessary(origPath);

utilsHandler.saveToDatabase(
new OperationData(
UtilsHandler.Operation.SFTP,
encryptedPath,
"Test",
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
null,
null));

await().atMost(10, TimeUnit.SECONDS).until(() -> utilsHandler.getSftpList().size() > 0);

List<String[]> result = utilsHandler.getSftpList();
final Completable operation =
utilsHandler.saveToDatabase(
new OperationData(
UtilsHandler.Operation.SFTP,
encryptedPath,
"Test",
"00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
null,
null));
operation.blockingAwait();

final List<String[]> result = utilsHandler.getSftpList();
assertFalse(result.isEmpty());
assertEquals(1, result.size());
assertEquals("Test", result.get(0)[0]);
assertEquals(encryptedPath, result.get(0)[1]);
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ org.gradle.parallel=true
android.disableResourceValidation=true
# for macs, omit for other operating systems
# org.gradle.java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home

# Enabled parallel sync for Gradle 9.4+
org.gradle.tooling.parallel=true
Loading