chibenwa commented on a change in pull request #716:
URL: https://github.com/apache/james-project/pull/716#discussion_r740869987



##########
File path: 
server/protocols/jmap-rfc-8621/src/test/scala/org/apache/james/jmap/pushsubscription/PushSubscriptionSetCreateProcessorTest.scala
##########
@@ -65,9 +71,35 @@ class PushSubscriptionSetCreateProcessorTest {
   @Test
   def pushVerificationShouldSuccess(pushServer: ClientAndServer): Unit = {
     testee.pushVerificationToPushServer(pushServerUrl, 
PUSH_VERIFICATION_SAMPLE, None).block()
+    
print(Json.stringify(PushSerializer.serializePushVerification(PUSH_VERIFICATION_SAMPLE)))
     pushServer.verify(request()
       .withPath("/subscribe")
-      
.withBody(Json.stringify(PushSerializer.serializePushVerification(PUSH_VERIFICATION_SAMPLE))),
+      .withBody(json("""{
+                       |    "@type": "PushVerification",
+                       |    "pushSubscriptionId": 
"44111166-affc-4187-b974-0672e312b72e",
+                       |    "verificationCode": 
"2b295d19-b37a-4865-b93e-bbb59f76ffc0"
+                       |}""".stripMargin)),
+      VerificationTimes.atLeast(1))
+  }
+
+  @Test
+  def pushVerificationShouldEncryptedPayloadWhenAssignKeys(pushServer: 
ClientAndServer): Unit = {
+    val uaKeyPair: KeyPair = 
EllipticCurves.generateKeyPair(CurveType.NIST_P256)
+    val uaPublicKey: ECPublicKey = 
uaKeyPair.getPublic.asInstanceOf[ECPublicKey]
+    val authSecret: Array[Byte] = "secret123secret1".getBytes
+
+    val p256dh: String = 
Base64.getEncoder.encodeToString(uaPublicKey.getEncoded)
+    val auth: String = Base64.getEncoder.encodeToString(authSecret)
+
+    testee.pushVerificationToPushServer(pushServerUrl, 
PUSH_VERIFICATION_SAMPLE, Some(PushSubscriptionKeys(p256dh, auth))).block()
+    
print(Json.stringify(PushSerializer.serializePushVerification(PUSH_VERIFICATION_SAMPLE)))

Review comment:
       ```suggestion
   
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to