Search⌘ K
AI Features

Testing the Unary and Client Streaming RPCs

Explore how to test Unary and Client Streaming RPCs in a gRPC FTP service project. Learn to transfer and delete files between client and server, configure directories, compile the project, and run both server and client applications using command-line tools.

We added four modules to the FTP service project grpc-ftp-project. These are:

  1. The gRPC service definition in ftp-service-proto

  2. The server implementation in ftp-service

  3. The client implementation in ftp-service-client

  4. A sample CLI client ftp-service-cli-client to test the application

Create the file and directory

Our client application will send a file to the server. We will create this file named testFile in the ftp-service-cli-client directory. Add some dummy text to the file.

Next, we need to create the folder on the server where the files will be stored. As per our logic, the files are first stored in a temporary directory and then once the transfer is complete, the file is moved to the destination folder. These directories are specified in the server configuration propertiesServer_configuration_properties file. In the parent project grpc-ftp-project, we will create a folder destOnServer. This is the destination folder where the files will be stored. We will also create a folder tmp inside the destOnServer folder. ...