Skip to content

Commit

Permalink
#21 #25 fix async test exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jcai committed Jul 2, 2020
1 parent 9b3b5f7 commit c99a807
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package wechaty.padplus.support

import org.junit.jupiter.api.Test
import org.grpcmock.GrpcMock.{stubFor, unaryMethod}
import org.junit.jupiter.api.{Assertions, Test}
import wechaty.padplus.PadplusTestEventBase
import wechaty.padplus.grpc.PadPlusServerGrpc
import wechaty.padplus.grpc.PadPlusServerOuterClass.{ResponseObject, ResponseType}
import wechaty.padplus.schemas.ModelContact.GrpcContactPayload

import scala.concurrent.Await
import scala.concurrent.duration._



Expand All @@ -14,18 +21,14 @@ class ContactRawSupportTest extends PadplusTestEventBase{

@Test
def testGetContact: Unit ={
/*
val responseBuilder = ResponseObject.newBuilder.setResult("success")
stubFor(unaryMethod(PadPlusServerGrpc.getRequestMethod)
.willReturn(responseBuilder.build())
)

val future = Future[ContactPayload] {
val contactId = "contactId"
instance.contactPayload(contactId)
}
val contactId = "contactId"
val future = instance.contactPayload(contactId)

Thread.sleep(TimeUnit.SECONDS.toMillis(2))

val grpcContact = new GrpcContactPayload
grpcContact.UserName="jcai"
Expand All @@ -35,7 +38,5 @@ class ContactRawSupportTest extends PadplusTestEventBase{
val payload = Await.result(future,10 seconds)
Assertions.assertEquals("jcai",payload.id)
awaitEventCompletion()
*/
}
}

0 comments on commit c99a807

Please sign in to comment.