Test kits for servers to simplify unit testing and component testing
Capability to run the server locally
Unit Testings
Just test functions without starting neither server or the client
Component Testing - Client code
In this mode, server will be already running.
start client
using client call the server
close the client
// Create a client that can send requests to the server
MapperTestKit.Client client = new MapperTestKit.Client();
MapperTestKit.TestDatum datum = MapperTestKit.TestDatum
.builder()
.value("2".getBytes())
.build();
MessageList result = client.sendRequest(new String[]{}, datum);
client.close();
Server code for just testing the UDFs locally
start server
open client
using client invoke the RPCs functions on server
close client
showdown server
// Start the server locally. This will initiate the server on localhost and port 50051
Server server = new Server(new EvenOddFunction());
// Start the server
server.start();
// Wait for the server to shutdown
server.awaitTermination();
Unit Testings
Just test functions without starting neither server or the client
Component Testing - Client code
In this mode, server will be already running.
Server code for just testing the UDFs locally
fixes https://github.com/numaproj/numaflow/issues/1625