19
19
import static org .junit .Assert .assertFalse ;
20
20
import static org .junit .Assert .assertNotNull ;
21
21
import static org .junit .Assert .assertTrue ;
22
+ import static org .junit .Assert .fail ;
22
23
23
24
/**
24
25
* Test the Plexus Cipher container
@@ -30,7 +31,7 @@ public class DefaultPlexusCipherTest {
30
31
31
32
final String str = "my testing phrase" ;
32
33
33
- final String encStr = "LFulS0pAlmMHpDtm+81oPcqctcwpco5p4Fo7640/gqDRifCahXBefG4FxgKcu17v " ;
34
+ final String encStr = "cYrPoOelYU0HGlsn3nERAIyiLVVgnsn/KC5ZqeAPG0beOZCYrFwWwBTp3uyxt/yx " ;
34
35
35
36
DefaultPlexusCipher pc ;
36
37
@@ -137,11 +138,14 @@ public void testEncryptVariableLengths() throws Exception {
137
138
assertEquals ("Encryption/Decryption did not produce desired result" , str , res );
138
139
}
139
140
}
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
+ }
145
149
}
146
150
147
151
// -------------------------------------------------------------
0 commit comments