12
12
import java .io .ByteArrayInputStream ;
13
13
import java .io .IOException ;
14
14
import java .security .NoSuchAlgorithmException ;
15
- import java .security .spec .InvalidKeySpecException ;
16
15
import java .util .List ;
17
16
import java .util .Set ;
18
17
19
18
public class ResponseBodyV2DecodedPayloadTest {
20
19
21
20
@ Test
22
- public void testNotificationDecoding () throws IOException , NoSuchAlgorithmException , InvalidKeySpecException , VerificationException {
21
+ public void testNotificationDecoding () throws IOException , NoSuchAlgorithmException , VerificationException {
23
22
String signedNotification = SignedDataCreator .createSignedDataFromJson ("models/signedNotification.json" );
24
23
25
24
ResponseBodyV2DecodedPayload notification = TestingUtility .getSignedPayloadVerifier ().verifyAndDecodeNotification (signedNotification );
@@ -46,7 +45,7 @@ public void testNotificationDecoding() throws IOException, NoSuchAlgorithmExcept
46
45
}
47
46
48
47
@ Test
49
- public void testSummaryNotificationDecoding () throws IOException , NoSuchAlgorithmException , InvalidKeySpecException , VerificationException {
48
+ public void testSummaryNotificationDecoding () throws IOException , NoSuchAlgorithmException , VerificationException {
50
49
String signedNotification = SignedDataCreator .createSignedDataFromJson ("models/signedSummaryNotification.json" );
51
50
52
51
ResponseBodyV2DecodedPayload notification = TestingUtility .getSignedPayloadVerifier ().verifyAndDecodeNotification (signedNotification );
@@ -73,12 +72,12 @@ public void testSummaryNotificationDecoding() throws IOException, NoSuchAlgorith
73
72
}
74
73
75
74
@ Test
76
- public void testExternalPurchaseTokenNotificationDecoding () throws IOException , NoSuchAlgorithmException , InvalidKeySpecException , VerificationException {
75
+ public void testExternalPurchaseTokenNotificationDecoding () throws IOException , NoSuchAlgorithmException , VerificationException {
77
76
String signedNotification = SignedDataCreator .createSignedDataFromJson ("models/signedExternalPurchaseTokenNotification.json" );
78
77
79
78
SignedDataVerifier verifier = new SignedDataVerifier (Set .of (new ByteArrayInputStream (TestingUtility .readBytes ("certs/testCA.der" ))), "com.example" , 1234L , Environment .LOCAL_TESTING , false ) {
80
79
@ Override
81
- protected void verifyNotification (String bundleId , Long appAppleId , Environment notificationEnv ) throws VerificationException {
80
+ protected void verifyNotification (String bundleId , Long appAppleId , Environment notificationEnv ) {
82
81
Assertions .assertEquals ("com.example" , bundleId );
83
82
Assertions .assertEquals (55555 , appAppleId );
84
83
Assertions .assertEquals (Environment .PRODUCTION , notificationEnv );
@@ -104,12 +103,12 @@ protected void verifyNotification(String bundleId, Long appAppleId, Environment
104
103
}
105
104
106
105
@ Test
107
- public void testExternalPurchaseTokenSandboxNotificationDecoding () throws IOException , NoSuchAlgorithmException , InvalidKeySpecException , VerificationException {
106
+ public void testExternalPurchaseTokenSandboxNotificationDecoding () throws IOException , NoSuchAlgorithmException , VerificationException {
108
107
String signedNotification = SignedDataCreator .createSignedDataFromJson ("models/signedExternalPurchaseTokenSandboxNotification.json" );
109
108
110
109
SignedDataVerifier verifier = new SignedDataVerifier (Set .of (new ByteArrayInputStream (TestingUtility .readBytes ("certs/testCA.der" ))), "com.example" , 1234L , Environment .LOCAL_TESTING , false ) {
111
110
@ Override
112
- protected void verifyNotification (String bundleId , Long appAppleId , Environment notificationEnv ) throws VerificationException {
111
+ protected void verifyNotification (String bundleId , Long appAppleId , Environment notificationEnv ) {
113
112
Assertions .assertEquals ("com.example" , bundleId );
114
113
Assertions .assertEquals (55555 , appAppleId );
115
114
Assertions .assertEquals (Environment .SANDBOX , notificationEnv );
0 commit comments