Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit b797a69

Browse files
committed
Enable missed decryption test and adjust to new algorithm after #23
1 parent c98ebeb commit b797a69

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/test/java/org/sonatype/plexus/components/cipher/DefaultPlexusCipherTest.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.junit.Assert.assertFalse;
2020
import static org.junit.Assert.assertNotNull;
2121
import static org.junit.Assert.assertTrue;
22+
import static org.junit.Assert.fail;
2223

2324
/**
2425
* Test the Plexus Cipher container
@@ -30,7 +31,7 @@ public class DefaultPlexusCipherTest {
3031

3132
final String str = "my testing phrase";
3233

33-
final String encStr = "LFulS0pAlmMHpDtm+81oPcqctcwpco5p4Fo7640/gqDRifCahXBefG4FxgKcu17v";
34+
final String encStr = "cYrPoOelYU0HGlsn3nERAIyiLVVgnsn/KC5ZqeAPG0beOZCYrFwWwBTp3uyxt/yx";
3435

3536
DefaultPlexusCipher pc;
3637

@@ -137,11 +138,14 @@ public void testEncryptVariableLengths() throws Exception {
137138
assertEquals("Encryption/Decryption did not produce desired result", str, res);
138139
}
139140
}
140-
141-
// -------------------------------------------------------------
142-
public void testDecrypt() throws Exception {
143-
String res = pc.decrypt(encStr, passPhrase);
144-
assertEquals("Decryption did not produce desired result", str, res);
141+
@Test
142+
public void testDecrypt() {
143+
try {
144+
String res = pc.decrypt(encStr, passPhrase);
145+
assertEquals("Decryption did not produce desired result", str, res);
146+
} catch (Exception e) {
147+
fail("Decryption failed: " + e.getMessage());
148+
}
145149
}
146150

147151
// -------------------------------------------------------------

0 commit comments

Comments
 (0)