File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/test/java/com/amazonaws/encryptionsdk Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 13
13
14
14
package com .amazonaws .encryptionsdk ;
15
15
16
+ import com .amazonaws .encryptionsdk .internal .StaticKeyring ;
16
17
import com .amazonaws .encryptionsdk .keyrings .Keyring ;
17
18
import org .junit .jupiter .api .Test ;
18
19
import org .junit .jupiter .api .extension .ExtendWith ;
@@ -27,7 +28,7 @@ class DecryptRequestTest {
27
28
28
29
@ Mock private Keyring keyring ;
29
30
@ Mock private ParsedCiphertext parsedCiphertext ;
30
- private static final byte [] CIPHERTEXT = new byte [] {1 , 2 ,3 };
31
+ private static final byte [] CIPHERTEXT = new byte [] {1 ,2 ,3 };
31
32
32
33
@ Test
33
34
void testBothCiphertextAndParsedCiphertext () {
@@ -50,9 +51,15 @@ void testNeitherCiphertextOrParsedCiphertext() {
50
51
@ Test
51
52
void testKeyringUsesDefaultCmm () {
52
53
54
+ byte [] ciphertext = new AwsCrypto ().encrypt (EncryptRequest .builder ()
55
+ .keyring (new StaticKeyring ("keyId" ))
56
+ .plaintext (new byte []{4 , 5 , 6 })
57
+ .build ()).getResult ();
58
+
59
+
53
60
assertTrue (DecryptRequest .builder ()
54
61
.keyring (keyring )
55
- .ciphertext (CIPHERTEXT ).build ().cryptoMaterialsManager ()
62
+ .ciphertext (ciphertext ).build ().cryptoMaterialsManager ()
56
63
instanceof DefaultCryptoMaterialsManager );
57
64
}
58
65
}
You can’t perform that action at this time.
0 commit comments