Uh oh!
There was an error while loading. Please reload this page.
issue #1317 WKD client - #1377
Conversation
| fun nonExistingEmailTest() { | ||
| val keys = WkdClient.lookupEmail("no.such.email.for.sure@flowcrypt.com") | ||
| assertTrue("Key found for non-existing email", keys == null) | ||
| } |
There was a problem hiding this comment.
Looks great, should also test the following:
In both cases, it should return no pubkey without throwing or failing.
Timeout is 3 seconds when it cannot reach, then it returns 'no pubkey'.
There was a problem hiding this comment.
@tomholub
I've added tests with these emails.
In TypeScript timeout was 4 seconds, so I've used that.
Not sure how to test what will happen on timeout expiration.
tomholub
commented
Jul 30, 2021
via email
den may know. else all good! …On Friday, July 30, 2021, Ivan Pizhenko ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In FlowCrypt/src/test/java/com/flowcrypt/email/api/email/WkdClientTest.kt
<#1377 (comment)>
:
> +import org.junit.Assert.assertTrue
+import org.junit.Test
+
+class WkdClientTest {
+ @test
+ fun existingEmailTest() {
+ val keys = ***@***.***")
+ assertTrue("Key not found", keys != null)
+ assertTrue("There are no keys in the key collection", keys!!.keyRings.hasNext())
+ }
+
+ @test
+ fun nonExistingEmailTest() {
+ val keys = ***@***.***")
+ assertTrue("Key found for non-existing email", keys == null)
+ }
@tomholub <https://github.com/tomholub>
I've added tests with these emails.
In TypeScript timeout was 4 seconds, so I've used that.
Not sure how to test what will happen on timeout expiration.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1377 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQDZEIFWBSFCMYNL6GRBQLT2MGENANCNFSM5BJC4MNQ>
.
-- --
Tom James Holub <http://holub.me/> |
@DenBond7 Any ideas how to test request timeout? Tom says you may know. |
IvanPizhenko
commented
Jul 31, 2021
So I am merging this as and test for timeout will be added in separate issue. I think I've got an idea how to do it. |
DenBond7
commented
Jul 31, 2021
Sorry, I can't look at that until Monday. I'm a little far from my PC. |
IvanPizhenko
commented
Jul 31, 2021
No problem. |
This PR adds WKD client class with logic ported from Typescript
close#1317
Tests(delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):