Port Android server runtime to GaCy Go
This commit is contained in:
1 parent
92a4b4f545
commit
3c1186c781
20 files changed
+830
-798
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package com.gacy.android
|
||||
|
||||
import com.gacy.android.data.parseUnstuckResponse
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class UnstuckResponseTest {
|
||||
@Test fun confirmsOnlyQueuedRequestsWithAnId() {
|
||||
assertTrue(parseUnstuckResponse("""{"state":"queued","request_id":"abc"}""").success)
|
||||
assertFalse(parseUnstuckResponse("""{"retcode":0,"message":"OK"}""").success)
|
||||
assertFalse(parseUnstuckResponse("""{"state":"queued"}""").success)
|
||||
assertFalse(parseUnstuckResponse("""{"state":"queued","request_id":null}""").success)
|
||||
assertFalse(parseUnstuckResponse("""{"state":"failed","request_id":"abc"}""").success)
|
||||
assertFalse(parseUnstuckResponse("not json").success)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user