diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VoiceVerificationController.java b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VoiceVerificationController.java index 3c16666c6..c4f73fa25 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VoiceVerificationController.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/controllers/VoiceVerificationController.java @@ -23,32 +23,34 @@ import org.whispersystems.textsecuregcm.util.Util; @Path("/v1/voice/") public class VoiceVerificationController { - private static final String PLAY_TWIML = "\n" + - "\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " \n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " \n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - " %s\n" + - ""; + private static final String PLAY_TWIML = """ + + + %s + %s + %s + %s + %s + %s + %s + + %s + %s + %s + %s + %s + %s + %s + + %s + %s + %s + %s + %s + %s + %s + + """; private static final String DEFAULT_LOCALE = "en-US"; diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfigurationTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfigurationTest.java index f8718e24b..c405e8ac3 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfigurationTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/configuration/dynamic/DynamicConfigurationTest.java @@ -38,18 +38,19 @@ class DynamicConfigurationTest { } { - final String experimentConfigYaml = - "experiments:\n" + - " percentageOnly:\n" + - " enrollmentPercentage: 12\n" + - " uuidsAndPercentage:\n" + - " enrolledUuids:\n" + - " - 717b1c09-ed0b-4120-bb0e-f4697534b8e1\n" + - " - 279f264c-56d7-4bbf-b9da-de718ff90903\n" + - " enrollmentPercentage: 77\n" + - " uuidsOnly:\n" + - " enrolledUuids:\n" + - " - 71618739-114c-4b1f-bb0d-6478a44eb600"; + final String experimentConfigYaml = """ + experiments: + percentageOnly: + enrollmentPercentage: 12 + uuidsAndPercentage: + enrolledUuids: + - 717b1c09-ed0b-4120-bb0e-f4697534b8e1 + - 279f264c-56d7-4bbf-b9da-de718ff90903 + enrollmentPercentage: 77 + uuidsOnly: + enrolledUuids: + - 71618739-114c-4b1f-bb0d-6478a44eb600 + """; final DynamicConfiguration config = DynamicConfigurationManager.parseConfiguration(experimentConfigYaml, DynamicConfiguration.class).orElseThrow(); @@ -86,27 +87,28 @@ class DynamicConfigurationTest { } { - final String experimentConfigYaml = - "preRegistrationExperiments:\n" + - " percentageOnly:\n" + - " enrollmentPercentage: 17\n" + - " e164sCountryCodesAndPercentage:\n" + - " enrolledE164s:\n" + - " - +120255551212\n" + - " - +3655323174\n" + - " excludedE164s:\n" + - " - +120255551213\n" + - " - +3655323175\n" + - " enrollmentPercentage: 46\n" + - " excludedCountryCodes:\n" + - " - 47\n" + - " includedCountryCodes:\n" + - " - 56\n" + - " e164sAndExcludedCodes:\n" + - " enrolledE164s:\n" + - " - +120255551212\n" + - " excludedCountryCodes:\n" + - " - 47"; + final String experimentConfigYaml = """ + preRegistrationExperiments: + percentageOnly: + enrollmentPercentage: 17 + e164sCountryCodesAndPercentage: + enrolledE164s: + - +120255551212 + - +3655323174 + excludedE164s: + - +120255551213 + - +3655323175 + enrollmentPercentage: 46 + excludedCountryCodes: + - 47 + includedCountryCodes: + - 56 + e164sAndExcludedCodes: + enrolledE164s: + - +120255551212 + excludedCountryCodes: + - 47 + """; final DynamicConfiguration config = DynamicConfigurationManager.parseConfiguration(experimentConfigYaml, DynamicConfiguration.class).orElseThrow(); @@ -167,18 +169,17 @@ class DynamicConfigurationTest { } { - final String remoteDeprecationConfig = - "remoteDeprecation:\n" + - " minimumVersions:\n" + - " IOS: 1.2.3\n" + - " ANDROID: 4.5.6\n" + - - " versionsPendingDeprecation:\n" + - " DESKTOP: 7.8.9\n" + - - " blockedVersions:\n" + - " DESKTOP:\n" + - " - 1.4.0-beta.2"; + final String remoteDeprecationConfig = """ + remoteDeprecation: + minimumVersions: + IOS: 1.2.3 + ANDROID: 4.5.6 + versionsPendingDeprecation: + DESKTOP: 7.8.9 + blockedVersions: + DESKTOP: + - 1.4.0-beta.2 + """; final DynamicConfiguration config = DynamicConfigurationManager.parseConfiguration(remoteDeprecationConfig, DynamicConfiguration.class).orElseThrow(); @@ -207,9 +208,10 @@ class DynamicConfigurationTest { } { - final String messageRateConfigYaml = - "messageRate:\n" + - " enforceUnsealedSenderRateLimit: true"; + final String messageRateConfigYaml = """ + messageRate: + enforceUnsealedSenderRateLimit: true + """; final DynamicConfiguration emptyConfig = DynamicConfigurationManager.parseConfiguration(messageRateConfigYaml, DynamicConfiguration.class).orElseThrow(); @@ -229,9 +231,10 @@ class DynamicConfigurationTest { } { - final String featureFlagYaml = - "featureFlags:\n" - + " - testFlag"; + final String featureFlagYaml = """ + featureFlags: + - testFlag + """; final DynamicConfiguration emptyConfig = DynamicConfigurationManager.parseConfiguration(featureFlagYaml, DynamicConfiguration.class).orElseThrow(); @@ -251,11 +254,12 @@ class DynamicConfigurationTest { } { - final String twilioConfigYaml = - "twilio:\n" - + " numbers:\n" - + " - 2135551212\n" - + " - 2135551313"; + final String twilioConfigYaml = """ + twilio: + numbers: + - 2135551212 + - 2135551313 + """; final DynamicTwilioConfiguration config = DynamicConfigurationManager.parseConfiguration(twilioConfigYaml, DynamicConfiguration.class).orElseThrow() @@ -276,10 +280,11 @@ class DynamicConfigurationTest { } { - final String paymentsConfigYaml = - "payments:\n" - + " disallowedPrefixes:\n" - + " - +44"; + final String paymentsConfigYaml = """ + payments: + disallowedPrefixes: + - +44 + """; final DynamicPaymentsConfiguration config = DynamicConfigurationManager.parseConfiguration(paymentsConfigYaml, DynamicConfiguration.class).orElseThrow() @@ -300,10 +305,11 @@ class DynamicConfigurationTest { } { - final String signupCaptchaConfig = - "signupCaptcha:\n" - + " countryCodes:\n" - + " - 1"; + final String signupCaptchaConfig = """ + signupCaptcha: + countryCodes: + - 1 + """; final DynamicSignupCaptchaConfiguration config = DynamicConfigurationManager.parseConfiguration(signupCaptchaConfig, DynamicConfiguration.class).orElseThrow() @@ -325,11 +331,12 @@ class DynamicConfigurationTest { } { - final String limitsConfig = - "limits:\n" - + " unsealedSenderNumber:\n" - + " maxCardinality: 99\n" - + " ttl: PT23H"; + final String limitsConfig = """ + limits: + unsealedSenderNumber: + maxCardinality: 99 + ttl: PT23H + """; final CardinalityRateLimitConfiguration unsealedSenderNumber = DynamicConfigurationManager.parseConfiguration(limitsConfig, DynamicConfiguration.class).orElseThrow() @@ -353,13 +360,14 @@ class DynamicConfigurationTest { } { - final String rateLimitChallengeConfig = - "rateLimitChallenge:\n" - + " preKeyLimitEnforced: true\n" - + " clientSupportedVersions:\n" - + " IOS: 5.1.0\n" - + " ANDROID: 5.2.0\n" - + " DESKTOP: 5.0.0"; + final String rateLimitChallengeConfig = """ + rateLimitChallenge: + preKeyLimitEnforced: true + clientSupportedVersions: + IOS: 5.1.0 + ANDROID: 5.2.0 + DESKTOP: 5.0.0 + """; DynamicRateLimitChallengeConfiguration rateLimitChallengeConfiguration = DynamicConfigurationManager.parseConfiguration(rateLimitChallengeConfig, DynamicConfiguration.class).orElseThrow() @@ -386,9 +394,10 @@ class DynamicConfigurationTest { } { - final String directoryReconcilerConfig = - "directoryReconciler:\n" - + " enabled: false"; + final String directoryReconcilerConfig = """ + directoryReconciler: + enabled: false + """; DynamicDirectoryReconcilerConfiguration directoryReconcilerConfiguration = DynamicConfigurationManager.parseConfiguration(directoryReconcilerConfig, DynamicConfiguration.class).orElseThrow() diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java index 066ed832b..279967924 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/controllers/ChallengeControllerTest.java @@ -56,10 +56,12 @@ class ChallengeControllerTest { @Test void testHandlePushChallenge() throws RateLimitExceededException { - final String pushChallengeJson = "{\n" - + " \"type\": \"rateLimitPushChallenge\",\n" - + " \"challenge\": \"Hello I am a push challenge token\"\n" - + "}"; + final String pushChallengeJson = """ + { + "type": "rateLimitPushChallenge", + "challenge": "Hello I am a push challenge token" + } + """; final Response response = EXTENSION.target("/v1/challenge") .request() @@ -72,10 +74,12 @@ class ChallengeControllerTest { @Test void testHandlePushChallengeRateLimited() throws RateLimitExceededException { - final String pushChallengeJson = "{\n" - + " \"type\": \"rateLimitPushChallenge\",\n" - + " \"challenge\": \"Hello I am a push challenge token\"\n" - + "}"; + final String pushChallengeJson = """ + { + "type": "rateLimitPushChallenge", + "challenge": "Hello I am a push challenge token" + } + """; final Duration retryAfter = Duration.ofMinutes(17); doThrow(new RateLimitExceededException(retryAfter)).when(rateLimitChallengeManager).answerPushChallenge(any(), any()); @@ -91,11 +95,13 @@ class ChallengeControllerTest { @Test void testHandleRecaptcha() throws RateLimitExceededException { - final String recaptchaChallengeJson = "{\n" - + " \"type\": \"recaptcha\",\n" - + " \"token\": \"A server-generated token\",\n" - + " \"captcha\": \"The value of the solved captcha token\"\n" - + "}"; + final String recaptchaChallengeJson = """ + { + "type": "recaptcha", + "token": "A server-generated token", + "captcha": "The value of the solved captcha token" + } + """; final Response response = EXTENSION.target("/v1/challenge") .request() @@ -109,11 +115,13 @@ class ChallengeControllerTest { @Test void testHandleRecaptchaRateLimited() throws RateLimitExceededException { - final String recaptchaChallengeJson = "{\n" - + " \"type\": \"recaptcha\",\n" - + " \"token\": \"A server-generated token\",\n" - + " \"captcha\": \"The value of the solved captcha token\"\n" - + "}"; + final String recaptchaChallengeJson = """ + { + "type": "recaptcha", + "token": "A server-generated token", + "captcha": "The value of the solved captcha token" + } + """; final Duration retryAfter = Duration.ofMinutes(17); doThrow(new RateLimitExceededException(retryAfter)).when(rateLimitChallengeManager).answerRecaptchaChallenge(any(), any(), any()); @@ -130,11 +138,13 @@ class ChallengeControllerTest { @Test void testHandleRecaptchaNoForwardedFor() { - final String recaptchaChallengeJson = "{\n" - + " \"type\": \"recaptcha\",\n" - + " \"token\": \"A server-generated token\",\n" - + " \"captcha\": \"The value of the solved captcha token\"\n" - + "}"; + final String recaptchaChallengeJson = """ + { + "type": "recaptcha", + "token": "A server-generated token", + "captcha": "The value of the solved captcha token" + } + """; final Response response = EXTENSION.target("/v1/challenge") .request() @@ -147,9 +157,11 @@ class ChallengeControllerTest { @Test void testHandleUnrecognizedAnswer() { - final String unrecognizedJson = "{\n" - + " \"type\": \"unrecognized\"\n" - + "}"; + final String unrecognizedJson = """ + { + "type": "unrecognized" + } + """; final Response response = EXTENSION.target("/v1/challenge") .request() @@ -187,9 +199,11 @@ class ChallengeControllerTest { @Test void testValidationError() { - final String unrecognizedJson = "{\n" - + " \"type\": \"rateLimitPushChallenge\"\n" - + "}"; + final String unrecognizedJson = """ + { + "type": "rateLimitPushChallenge" + } + """; final Response response = EXTENSION.target("/v1/challenge") .request() diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/entities/AnswerChallengeRequestTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/entities/AnswerChallengeRequestTest.java index faadfb519..9ff2d12eb 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/entities/AnswerChallengeRequestTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/entities/AnswerChallengeRequestTest.java @@ -17,10 +17,12 @@ class AnswerChallengeRequestTest { @Test void parse() throws JsonProcessingException { { - final String pushChallengeJson = "{\n" - + " \"type\": \"rateLimitPushChallenge\",\n" - + " \"challenge\": \"Hello I am a push challenge token\"\n" - + "}"; + final String pushChallengeJson = """ + { + "type": "rateLimitPushChallenge", + "challenge": "Hello I am a push challenge token" + } + """; final AnswerChallengeRequest answerChallengeRequest = SystemMapper.getMapper().readValue(pushChallengeJson, AnswerChallengeRequest.class); @@ -31,11 +33,13 @@ class AnswerChallengeRequestTest { } { - final String recaptchaChallengeJson = "{\n" - + " \"type\": \"recaptcha\",\n" - + " \"token\": \"A server-generated token\",\n" - + " \"captcha\": \"The value of the solved captcha token\"\n" - + "}"; + final String recaptchaChallengeJson = """ + { + "type": "recaptcha", + "token": "A server-generated token", + "captcha": "The value of the solved captcha token" + } + """; final AnswerChallengeRequest answerChallengeRequest = SystemMapper.getMapper().readValue(recaptchaChallengeJson, AnswerChallengeRequest.class); @@ -50,11 +54,13 @@ class AnswerChallengeRequestTest { } { - final String unrecognizedTypeJson = "{\n" - + " \"type\": \"unrecognized\",\n" - + " \"token\": \"A server-generated token\",\n" - + " \"captcha\": \"The value of the solved captcha token\"\n" - + "}"; + final String unrecognizedTypeJson = """ + { + "type": "unrecognized", + "token": "A server-generated token", + "captcha": "The value of the solved captcha token" + } + """; assertThrows(InvalidTypeIdException.class, () -> SystemMapper.getMapper().readValue(unrecognizedTypeJson, AnswerChallengeRequest.class)); diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/metrics/OperatingSystemMemoryGaugeTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/metrics/OperatingSystemMemoryGaugeTest.java index a2321cddb..fae450d22 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/metrics/OperatingSystemMemoryGaugeTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/metrics/OperatingSystemMemoryGaugeTest.java @@ -18,59 +18,61 @@ import static org.junit.Assert.*; public class OperatingSystemMemoryGaugeTest { private static final String MEMINFO = - "MemTotal: 16052208 kB\n" + - "MemFree: 4568468 kB\n" + - "MemAvailable: 7702848 kB\n" + - "Buffers: 636372 kB\n" + - "Cached: 5019116 kB\n" + - "SwapCached: 6692 kB\n" + - "Active: 7746436 kB\n" + - "Inactive: 2729876 kB\n" + - "Active(anon): 5580980 kB\n" + - "Inactive(anon): 1648108 kB\n" + - "Active(file): 2165456 kB\n" + - "Inactive(file): 1081768 kB\n" + - "Unevictable: 443948 kB\n" + - "Mlocked: 4924 kB\n" + - "SwapTotal: 1003516 kB\n" + - "SwapFree: 935932 kB\n" + - "Dirty: 28308 kB\n" + - "Writeback: 0 kB\n" + - "AnonPages: 5258396 kB\n" + - "Mapped: 1530740 kB\n" + - "Shmem: 2419340 kB\n" + - "KReclaimable: 229392 kB\n" + - "Slab: 408156 kB\n" + - "SReclaimable: 229392 kB\n" + - "SUnreclaim: 178764 kB\n" + - "KernelStack: 17360 kB\n" + - "PageTables: 50436 kB\n" + - "NFS_Unstable: 0 kB\n" + - "Bounce: 0 kB\n" + - "WritebackTmp: 0 kB\n" + - "CommitLimit: 9029620 kB\n" + - "Committed_AS: 16681884 kB\n" + - "VmallocTotal: 34359738367 kB\n" + - "VmallocUsed: 41944 kB\n" + - "VmallocChunk: 0 kB\n" + - "Percpu: 4240 kB\n" + - "HardwareCorrupted: 0 kB\n" + - "AnonHugePages: 0 kB\n" + - "ShmemHugePages: 0 kB\n" + - "ShmemPmdMapped: 0 kB\n" + - "FileHugePages: 0 kB\n" + - "FilePmdMapped: 0 kB\n" + - "CmaTotal: 0 kB\n" + - "CmaFree: 0 kB\n" + - "HugePages_Total: 0\n" + - "HugePages_Free: 7\n" + - "HugePages_Rsvd: 0\n" + - "HugePages_Surp: 0\n" + - "Hugepagesize: 2048 kB\n" + - "Hugetlb: 0 kB\n" + - "DirectMap4k: 481804 kB\n" + - "DirectMap2M: 14901248 kB\n" + - "DirectMap1G: 2097152 kB\n"; + """ + MemTotal: 16052208 kB + MemFree: 4568468 kB + MemAvailable: 7702848 kB + Buffers: 636372 kB + Cached: 5019116 kB + SwapCached: 6692 kB + Active: 7746436 kB + Inactive: 2729876 kB + Active(anon): 5580980 kB + Inactive(anon): 1648108 kB + Active(file): 2165456 kB + Inactive(file): 1081768 kB + Unevictable: 443948 kB + Mlocked: 4924 kB + SwapTotal: 1003516 kB + SwapFree: 935932 kB + Dirty: 28308 kB + Writeback: 0 kB + AnonPages: 5258396 kB + Mapped: 1530740 kB + Shmem: 2419340 kB + KReclaimable: 229392 kB + Slab: 408156 kB + SReclaimable: 229392 kB + SUnreclaim: 178764 kB + KernelStack: 17360 kB + PageTables: 50436 kB + NFS_Unstable: 0 kB + Bounce: 0 kB + WritebackTmp: 0 kB + CommitLimit: 9029620 kB + Committed_AS: 16681884 kB + VmallocTotal: 34359738367 kB + VmallocUsed: 41944 kB + VmallocChunk: 0 kB + Percpu: 4240 kB + HardwareCorrupted: 0 kB + AnonHugePages: 0 kB + ShmemHugePages: 0 kB + ShmemPmdMapped: 0 kB + FileHugePages: 0 kB + FilePmdMapped: 0 kB + CmaTotal: 0 kB + CmaFree: 0 kB + HugePages_Total: 0 + HugePages_Free: 7 + HugePages_Rsvd: 0 + HugePages_Surp: 0 + Hugepagesize: 2048 kB + Hugetlb: 0 kB + DirectMap4k: 481804 kB + DirectMap2M: 14901248 kB + DirectMap1G: 2097152 kB + """; @Test @Parameters(method = "argumentsForTestGetValue") diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/securebackup/SecureBackupClientTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/securebackup/SecureBackupClientTest.java index 7d9976cd4..7d3909fae 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/securebackup/SecureBackupClientTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/securebackup/SecureBackupClientTest.java @@ -55,22 +55,23 @@ public class SecureBackupClientTest { config.setUri("http://localhost:" + wireMockRule.port()); // This is a randomly-generated, throwaway certificate that's not actually connected to anything - config.setBackupCaCertificate( - "-----BEGIN CERTIFICATE-----\n" + - "MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEL\n" + - "MAkGA1UECAwCVVMxHjAcBgNVBAoMFVNpZ25hbCBNZXNzZW5nZXIsIExMQzETMBEG\n" + - "A1UEAwwKc2lnbmFsLm9yZzAeFw0yMDEyMjMyMjQ3NTlaFw0zMDEyMjEyMjQ3NTla\n" + - "ME8xCzAJBgNVBAYTAnVzMQswCQYDVQQIDAJVUzEeMBwGA1UECgwVU2lnbmFsIE1l\n" + - "c3NlbmdlciwgTExDMRMwEQYDVQQDDApzaWduYWwub3JnMIGfMA0GCSqGSIb3DQEB\n" + - "AQUAA4GNADCBiQKBgQCfSLcZNHYqbxSsgWp4JvbPRHjQTrlsrKrgD2q7f/OY6O3Y\n" + - "/X0QNcNSOJpliN8rmzwslfsrXHO3q1diGRw4xHogUJZ/7NQrHiP/zhN0VTDh49pD\n" + - "ZpjXVyUbayLS/6qM5arKxBspzEFBb5v8cF6bPr76SO/rpGXiI0j6yJKX6fRiKwID\n" + - "AQABo1AwTjAdBgNVHQ4EFgQU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwHwYDVR0jBBgw\n" + - "FoAU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B\n" + - "AQ0FAAOBgQB+5d5+NtzLILfrc9QmJdIO1YeDP64JmFwTER0kEUouRsb9UwknVWZa\n" + - "y7MTM4NoBV1k0zb5LAk89SIDPr/maW5AsLtEomzjnEiomjoMBUdNe3YCgQReoLnr\n" + - "R/QaUNbrCjTGYfBsjGbIzmkWPUyTec2ZdRyJ8JiVl386+6CZkxnndQ==\n" + - "-----END CERTIFICATE-----"); + config.setBackupCaCertificate(""" + -----BEGIN CERTIFICATE----- + MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEL + MAkGA1UECAwCVVMxHjAcBgNVBAoMFVNpZ25hbCBNZXNzZW5nZXIsIExMQzETMBEG + A1UEAwwKc2lnbmFsLm9yZzAeFw0yMDEyMjMyMjQ3NTlaFw0zMDEyMjEyMjQ3NTla + ME8xCzAJBgNVBAYTAnVzMQswCQYDVQQIDAJVUzEeMBwGA1UECgwVU2lnbmFsIE1l + c3NlbmdlciwgTExDMRMwEQYDVQQDDApzaWduYWwub3JnMIGfMA0GCSqGSIb3DQEB + AQUAA4GNADCBiQKBgQCfSLcZNHYqbxSsgWp4JvbPRHjQTrlsrKrgD2q7f/OY6O3Y + /X0QNcNSOJpliN8rmzwslfsrXHO3q1diGRw4xHogUJZ/7NQrHiP/zhN0VTDh49pD + ZpjXVyUbayLS/6qM5arKxBspzEFBb5v8cF6bPr76SO/rpGXiI0j6yJKX6fRiKwID + AQABo1AwTjAdBgNVHQ4EFgQU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwHwYDVR0jBBgw + FoAU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B + AQ0FAAOBgQB+5d5+NtzLILfrc9QmJdIO1YeDP64JmFwTER0kEUouRsb9UwknVWZa + y7MTM4NoBV1k0zb5LAk89SIDPr/maW5AsLtEomzjnEiomjoMBUdNe3YCgQReoLnr + R/QaUNbrCjTGYfBsjGbIzmkWPUyTec2ZdRyJ8JiVl386+6CZkxnndQ== + -----END CERTIFICATE----- + """); secureStorageClient = new SecureBackupClient(credentialGenerator, httpExecutor, config); } diff --git a/service/src/test/java/org/whispersystems/textsecuregcm/securestorage/SecureStorageClientTest.java b/service/src/test/java/org/whispersystems/textsecuregcm/securestorage/SecureStorageClientTest.java index 9b4ea87a7..ae8070da8 100644 --- a/service/src/test/java/org/whispersystems/textsecuregcm/securestorage/SecureStorageClientTest.java +++ b/service/src/test/java/org/whispersystems/textsecuregcm/securestorage/SecureStorageClientTest.java @@ -55,22 +55,23 @@ public class SecureStorageClientTest { config.setUri("http://localhost:" + wireMockRule.port()); // This is a randomly-generated, throwaway certificate that's not actually connected to anything - config.setStorageCaCertificate( - "-----BEGIN CERTIFICATE-----\n" + - "MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEL\n" + - "MAkGA1UECAwCVVMxHjAcBgNVBAoMFVNpZ25hbCBNZXNzZW5nZXIsIExMQzETMBEG\n" + - "A1UEAwwKc2lnbmFsLm9yZzAeFw0yMDEyMjMyMjQ3NTlaFw0zMDEyMjEyMjQ3NTla\n" + - "ME8xCzAJBgNVBAYTAnVzMQswCQYDVQQIDAJVUzEeMBwGA1UECgwVU2lnbmFsIE1l\n" + - "c3NlbmdlciwgTExDMRMwEQYDVQQDDApzaWduYWwub3JnMIGfMA0GCSqGSIb3DQEB\n" + - "AQUAA4GNADCBiQKBgQCfSLcZNHYqbxSsgWp4JvbPRHjQTrlsrKrgD2q7f/OY6O3Y\n" + - "/X0QNcNSOJpliN8rmzwslfsrXHO3q1diGRw4xHogUJZ/7NQrHiP/zhN0VTDh49pD\n" + - "ZpjXVyUbayLS/6qM5arKxBspzEFBb5v8cF6bPr76SO/rpGXiI0j6yJKX6fRiKwID\n" + - "AQABo1AwTjAdBgNVHQ4EFgQU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwHwYDVR0jBBgw\n" + - "FoAU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B\n" + - "AQ0FAAOBgQB+5d5+NtzLILfrc9QmJdIO1YeDP64JmFwTER0kEUouRsb9UwknVWZa\n" + - "y7MTM4NoBV1k0zb5LAk89SIDPr/maW5AsLtEomzjnEiomjoMBUdNe3YCgQReoLnr\n" + - "R/QaUNbrCjTGYfBsjGbIzmkWPUyTec2ZdRyJ8JiVl386+6CZkxnndQ==\n" + - "-----END CERTIFICATE-----"); + config.setStorageCaCertificate(""" + -----BEGIN CERTIFICATE----- + MIICZDCCAc2gAwIBAgIBADANBgkqhkiG9w0BAQ0FADBPMQswCQYDVQQGEwJ1czEL + MAkGA1UECAwCVVMxHjAcBgNVBAoMFVNpZ25hbCBNZXNzZW5nZXIsIExMQzETMBEG + A1UEAwwKc2lnbmFsLm9yZzAeFw0yMDEyMjMyMjQ3NTlaFw0zMDEyMjEyMjQ3NTla + ME8xCzAJBgNVBAYTAnVzMQswCQYDVQQIDAJVUzEeMBwGA1UECgwVU2lnbmFsIE1l + c3NlbmdlciwgTExDMRMwEQYDVQQDDApzaWduYWwub3JnMIGfMA0GCSqGSIb3DQEB + AQUAA4GNADCBiQKBgQCfSLcZNHYqbxSsgWp4JvbPRHjQTrlsrKrgD2q7f/OY6O3Y + /X0QNcNSOJpliN8rmzwslfsrXHO3q1diGRw4xHogUJZ/7NQrHiP/zhN0VTDh49pD + ZpjXVyUbayLS/6qM5arKxBspzEFBb5v8cF6bPr76SO/rpGXiI0j6yJKX6fRiKwID + AQABo1AwTjAdBgNVHQ4EFgQU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwHwYDVR0jBBgw + FoAU6Jrs/Fmj0z4dA3wvdq/WqA4P49IwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B + AQ0FAAOBgQB+5d5+NtzLILfrc9QmJdIO1YeDP64JmFwTER0kEUouRsb9UwknVWZa + y7MTM4NoBV1k0zb5LAk89SIDPr/maW5AsLtEomzjnEiomjoMBUdNe3YCgQReoLnr + R/QaUNbrCjTGYfBsjGbIzmkWPUyTec2ZdRyJ8JiVl386+6CZkxnndQ== + -----END CERTIFICATE----- + """); secureStorageClient = new SecureStorageClient(credentialGenerator, httpExecutor, config); }