Skip to content

Commit 1e816e4

Browse files
committed
Fixed test method names, updated test
1 parent c65cf24 commit 1e816e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/test/java/com/mastercard/developer/encryption/JweConfigBuilderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void testBuild_ResultShouldBeAssignableToGenericEncryptionConfig() throws
4141
}
4242

4343
@Test
44-
public void testBuild_ShouldComputeCertificateKeyFingerprints_WhenFingerprintsNotSet() throws Exception {
44+
public void testBuild_ShouldComputeCertificateKeyFingerprint_WhenFingerprintNotSet() throws Exception {
4545
EncryptionConfig config = JweConfigBuilder.aJweEncryptionConfig()
4646
.withEncryptionCertificate(TestUtils.getTestEncryptionCertificate())
4747
.withDecryptionKey(TestUtils.getTestDecryptionKey())
@@ -50,7 +50,7 @@ public void testBuild_ShouldComputeCertificateKeyFingerprints_WhenFingerprintsNo
5050
}
5151

5252
@Test
53-
public void testIntercept_ShouldThrowIOException_WhenEncryptionFails() throws Exception {
53+
public void testIntercept_ShouldThrowEncryptionException_WhenInvalidEncryptionCertificate() throws Exception {
5454
expectedException.expect(EncryptionException.class);
5555
expectedException.expectMessage("Failed to compute encryption key fingerprint!");
5656
JweConfigBuilder.aJweEncryptionConfig()
@@ -60,13 +60,13 @@ public void testIntercept_ShouldThrowIOException_WhenEncryptionFails() throws Ex
6060
}
6161

6262
@Test
63-
public void testBuild_ShouldAutoPopulateEncryptionAndDecryptionPaths() throws Exception {
63+
public void testBuild_ShouldFallbackToDefaults() throws Exception {
6464
EncryptionConfig config = JweConfigBuilder.aJweEncryptionConfig()
6565
.withEncryptionCertificate(TestUtils.getTestEncryptionCertificate())
66-
.withDecryptionKey(TestUtils.getTestDecryptionKey())
6766
.build();
6867
Assert.assertEquals(Collections.singletonMap("$.encryptedData", "$"), config.decryptionPaths);
6968
Assert.assertEquals(Collections.singletonMap("$", "$"), config.encryptionPaths);
69+
Assert.assertEquals("encryptedData", config.encryptedValueFieldName);
7070
}
7171

7272
@Test

0 commit comments

Comments
 (0)