@Nonnull
public CompletionStage<CliInbandOutput> invoke(@Nonnull final CliInbandInput input) {
final CliInband request = new CliInband();
- request.cmd = input.getCmd().getBytes(StandardCharsets.UTF_8);
- request.length = request.cmd.length;
+ request.cmd = input.getCmd();
return jvpp.cliInband(request)
- .thenApply(
- reply -> new CliInbandOutputBuilder().setReply(new String(reply.reply)).build()
- );
+ .thenApply(reply -> new CliInbandOutputBuilder().setReply(reply.reply).build());
}
@Nonnull
final CompletionStage<ShowVersionReply> showVersionFuture = getFutureJVpp().showVersion(new ShowVersion());
final ShowVersionReply reply = getReplyForRead(showVersionFuture.toCompletableFuture(), id);
- builder.setBranch(toString(reply.version));
- builder.setName(toString(reply.program));
- builder.setBuildDate(toString(reply.buildDate));
- builder.setBuildDirectory(toString(reply.buildDirectory));
+ builder.setBranch(reply.version);
+ builder.setName(reply.program);
+ builder.setBuildDate(reply.buildDate);
+ builder.setBuildDirectory(reply.buildDirectory);
builder.setPid(getPid(id));
}
final CliInbandService service = new CliInbandService(api);
final CliInbandReply reply = new CliInbandReply();
- reply.reply = replyString.getBytes();
+ reply.reply = replyString;
when(api.cliInband(any())).thenReturn(future(reply));
final CliInbandInput request = new CliInbandInputBuilder().setCmd("cmd").build();
private void whenShowVersionThenReturn(final Version version) {
final ShowVersionReply reply = new ShowVersionReply();
- reply.buildDate = version.getBuildDate().getBytes();
- reply.program = version.getName().getBytes();
- reply.version = version.getBranch().getBytes();
- reply.buildDirectory = version.getBuildDirectory().getBytes();
+ reply.buildDate = version.getBuildDate();
+ reply.program = version.getName();
+ reply.version = version.getBranch();
+ reply.buildDirectory = version.getBuildDirectory();
when(api.showVersion(ArgumentMatchers.any(ShowVersion.class))).thenReturn(future(reply));
// Version Customizer uses ControlPing to obtain PID
when(api.send(ArgumentMatchers.any(ControlPing.class))).thenReturn(future(new ControlPingReply()));