use of com.robo4j.core.StringProducer in project robo4j by Robo4J.
the class RoboHttpPingPongTest method configurePingSystem.
private RoboSystem configurePingSystem() throws Exception {
final RoboSystem result = new RoboSystem();
Configuration config = ConfigurationFactory.createEmptyConfiguration();
HttpClientUnit httpClient = new HttpClientUnit(result, "http_client");
config.setString("address", HOST_SYSTEM);
config.setInteger("port", PORT);
/* specific configuration */
Configuration targetUnits = config.createChildConfiguration(RoboHttpUtils.HTTP_TARGET_UNITS);
targetUnits.setString(CONTROLLER_PING_PONG, "POST");
httpClient.initialize(config);
StringProducer producer = new StringProducer(result, "http_producer");
config = ConfigurationFactory.createEmptyConfiguration();
config.setString("target", "http_client");
config.setString("method", "POST");
config.setString("uri", "/controller");
config.setString("targetAddress", HOST_SYSTEM);
producer.initialize(config);
result.addUnits(producer, httpClient);
return result;
}
Aggregations