diff options
author | Aurelien <100427063+aurelien-poscia-sonarsource@users.noreply.github.com> | 2022-08-11 12:05:44 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-08-11 20:03:47 +0000 |
commit | 056ad753c9c766a2441f66f181624c79227541a3 (patch) | |
tree | 4e3bb3188b7fd3e139c131f6d207f9c7d8619cd7 /sonar-plugin-api-impl/src/test | |
parent | d60decc7c085fac107651dab2bf622f18de0679d (diff) | |
download | sonarqube-056ad753c9c766a2441f66f181624c79227541a3.tar.gz sonarqube-056ad753c9c766a2441f66f181624c79227541a3.zip |
SONAR-17150 fix SSF-39
Diffstat (limited to 'sonar-plugin-api-impl/src/test')
-rw-r--r-- | sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/EncryptionTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/EncryptionTest.java b/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/EncryptionTest.java index 6a3fe819617..1f8651a9b1d 100644 --- a/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/EncryptionTest.java +++ b/sonar-plugin-api-impl/src/test/java/org/sonar/api/config/internal/EncryptionTest.java @@ -91,6 +91,16 @@ public class EncryptionTest { assertThat(encryption.decrypt("foo")).isEqualTo("foo"); } + @Test + public void should_notDecryptText_whenBadBraceSyntax(){ + Encryption encryption = new Encryption(null); + assertThat(encryption.decrypt("}xxx{Zm9v")).isEqualTo("}xxx{Zm9v"); + assertThat(encryption.decrypt("}dcd}59LK")).isEqualTo("}dcd}59LK"); + assertThat(encryption.decrypt("}rrrRg6")).isEqualTo("}rrrRg6"); + assertThat(encryption.decrypt("{closedjdk")).isEqualTo("{closedjdk"); + + } + private String pathToSecretKey() throws Exception { URL resource = getClass().getResource("/org/sonar/api/config/internal/AesCipherTest/aes_secret_key.txt"); return new File(resource.toURI()).getCanonicalPath(); |