@@ -9,6 +9,7 @@ import java.nio.file.Paths
99import com .google .protobuf .ByteString
1010import com .scalableminds .fossildb .db .StoreManager
1111import com .scalableminds .fossildb .proto .fossildbapi ._
12+ import io .grpc .health .v1 ._
1213import io .grpc .netty .NettyChannelBuilder
1314import org .scalatest .{BeforeAndAfterEach , FlatSpec }
1415
@@ -21,7 +22,9 @@ class FossilDBSuite extends FlatSpec with BeforeAndAfterEach {
2122
2223 val port = 21505
2324 var serverOpt : Option [FossilDBServer ] = None
24- val client = FossilDBGrpc .blockingStub(NettyChannelBuilder .forAddress(" 127.0.0.1" , port).maxInboundMessageSize(Int .MaxValue ).usePlaintext(true ).build)
25+ val channel = NettyChannelBuilder .forAddress(" 127.0.0.1" , port).maxInboundMessageSize(Int .MaxValue ).usePlaintext().build
26+ val client = FossilDBGrpc .blockingStub(channel)
27+ val healthClient = HealthGrpc .newBlockingStub(channel)
2528
2629 val collectionA = " collectionA"
2730 val collectionB = " collectionB"
@@ -65,6 +68,11 @@ class FossilDBSuite extends FlatSpec with BeforeAndAfterEach {
6568 assert(reply.success)
6669 }
6770
71+ " GRPC Standard Health Check" should " report SERVING" in {
72+ val reply = healthClient.check(HealthCheckRequest .getDefaultInstance())
73+ assert(reply.getStatus.toString == " SERVING" )
74+ }
75+
6876 " Put" should " overwrite old value" in {
6977 client.put(PutRequest (collectionA, aKey, Some (0 ), testData1))
7078 client.put(PutRequest (collectionA, aKey, Some (0 ), testData2))
0 commit comments