mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 10:11:27 +00:00
using text blocks where applicable
This commit is contained in:
@@ -47,10 +47,12 @@ public abstract class CommonsModule {
|
||||
@Named("licensePublicKey")
|
||||
static String provideLicensePublicKey() {
|
||||
// in PEM format without the dash-escaped begin/end lines
|
||||
return "MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQB7NfnqiZbg2KTmoflmZ71PbXru7oW" //
|
||||
+ "fmnV2yv3eDjlDfGruBrqz9TtXBZV/eYWt31xu1osIqaT12lKBvZ511aaAkIBeOEV" //
|
||||
+ "gwcBIlJr6kUw7NKzeJt7r2rrsOyQoOG2nWc/Of/NBqA3mIZRHk5Aq1YupFdD26QE" //
|
||||
+ "r0DzRyj4ixPIt38CQB8=";
|
||||
return """
|
||||
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQB7NfnqiZbg2KTmoflmZ71PbXru7oW\
|
||||
fmnV2yv3eDjlDfGruBrqz9TtXBZV/eYWt31xu1osIqaT12lKBvZ511aaAkIBeOEV\
|
||||
gwcBIlJr6kUw7NKzeJt7r2rrsOyQoOG2nWc/Of/NBqA3mIZRHk5Aq1YupFdD26QE\
|
||||
r0DzRyj4ixPIt38CQB8=\
|
||||
""";
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -9,10 +9,12 @@ import java.util.Optional;
|
||||
|
||||
class LicenseCheckerTest {
|
||||
|
||||
private static final String PUBLIC_KEY = "MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBgc4HZz+/fBbC7lmEww0AO3NK9wVZ" //
|
||||
+ "PDZ0VEnsaUFLEYpTzb90nITtJUcPUbvOsdZIZ1Q8fnbquAYgxXL5UgHMoywAib47" //
|
||||
+ "6MkyyYgPk0BXZq3mq4zImTRNuaU9slj9TVJ3ScT3L1bXwVuPJDzpr5GOFpaj+WwM" //
|
||||
+ "Al8G7CqwoJOsW7Kddns=";
|
||||
private static final String PUBLIC_KEY = """
|
||||
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBgc4HZz+/fBbC7lmEww0AO3NK9wVZ\
|
||||
PDZ0VEnsaUFLEYpTzb90nITtJUcPUbvOsdZIZ1Q8fnbquAYgxXL5UgHMoywAib47\
|
||||
6MkyyYgPk0BXZq3mq4zImTRNuaU9slj9TVJ3ScT3L1bXwVuPJDzpr5GOFpaj+WwM\
|
||||
Al8G7CqwoJOsW7Kddns=\
|
||||
""";
|
||||
|
||||
private LicenseChecker licenseChecker;
|
||||
|
||||
|
||||
@@ -21,13 +21,18 @@ public class SettingsJsonAdapterTest {
|
||||
|
||||
@Test
|
||||
public void testDeserialize() throws IOException {
|
||||
String vault1Json = "{\"id\": \"1\", \"path\": \"/vault1\", \"mountName\": \"vault1\", \"winDriveLetter\": \"X\"}";
|
||||
String vault2Json = "{\"id\": \"2\", \"path\": \"/vault2\", \"mountName\": \"vault2\", \"winDriveLetter\": \"Y\"}";
|
||||
String json = "{\"directories\": [" + vault1Json + "," + vault2Json + "]," //
|
||||
+ "\"checkForUpdatesEnabled\": true,"//
|
||||
+ "\"port\": 8080,"//
|
||||
+ "\"numTrayNotifications\": 42,"//
|
||||
+ "\"preferredVolumeImpl\": \"FUSE\"}";
|
||||
String json = """
|
||||
{
|
||||
"directories": [
|
||||
{"id": "1", "path": "/vault1", "mountName": "vault1", "winDriveLetter": "X"},
|
||||
{"id": "2", "path": "/vault2", "mountName": "vault2", "winDriveLetter": "Y"}
|
||||
],
|
||||
"checkForUpdatesEnabled": true,
|
||||
"port": 8080,
|
||||
"numTrayNotifications": 42,
|
||||
"preferredVolumeImpl": "FUSE"
|
||||
}
|
||||
""";
|
||||
|
||||
Settings settings = adapter.fromJson(json);
|
||||
|
||||
|
||||
@@ -48,18 +48,22 @@ class RecoveryKeyFactoryTest {
|
||||
@Test
|
||||
@DisplayName("validateRecoveryKey() with invalid checksum")
|
||||
public void testValidateValidateRecoveryKeyWithInvalidCrc() {
|
||||
boolean result = inTest.validateRecoveryKey("pathway lift abuse plenty export texture gentleman landscape beyond ceiling around leaf cafe" //
|
||||
+ " charity border breakdown victory surely computer cat linger restrict infer crowd live computer true written amazed investor boot" //
|
||||
+ " depth left theory snow whereby terminal weekly reject happiness circuit partial cup wrong");
|
||||
boolean result = inTest.validateRecoveryKey("""
|
||||
pathway lift abuse plenty export texture gentleman landscape beyond ceiling around leaf cafe charity \
|
||||
border breakdown victory surely computer cat linger restrict infer crowd live computer true written amazed \
|
||||
investor boot depth left theory snow whereby terminal weekly reject happiness circuit partial cup wrong \
|
||||
""");
|
||||
Assertions.assertFalse(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("validateRecoveryKey() with valid input")
|
||||
public void testValidateValidateRecoveryKeyWithValidKey() {
|
||||
boolean result = inTest.validateRecoveryKey("pathway lift abuse plenty export texture gentleman landscape beyond ceiling around leaf cafe" //
|
||||
+ " charity border breakdown victory surely computer cat linger restrict infer crowd live computer true written amazed investor boot" //
|
||||
+ " depth left theory snow whereby terminal weekly reject happiness circuit partial cup ad");
|
||||
boolean result = inTest.validateRecoveryKey("""
|
||||
pathway lift abuse plenty export texture gentleman landscape beyond ceiling around leaf cafe charity \
|
||||
border breakdown victory surely computer cat linger restrict infer crowd live computer true written amazed \
|
||||
investor boot depth left theory snow whereby terminal weekly reject happiness circuit partial cup ad \
|
||||
""");
|
||||
Assertions.assertTrue(result);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user