diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2018-12-14 09:39:12 +0100 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2018-12-14 09:39:12 +0100 |
commit | d93a19d6d95d41f2a6287a737a5582ff12f4a0a7 (patch) | |
tree | ea2bc9a0cf03a8e9c07d5e91494533b7502004c8 /vpp-management | |
parent | 91db56913c9b1fc9292637adf4d96a052a737f61 (diff) |
adapt to string type changes in JVPP
Change-Id: Ic3a01740290a2af37c495318f2aa5422f5fe06cd
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'vpp-management')
4 files changed, 11 insertions, 14 deletions
diff --git a/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/rpc/CliInbandService.java b/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/rpc/CliInbandService.java index ab55abe3f..fd1b18eee 100644 --- a/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/rpc/CliInbandService.java +++ b/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/rpc/CliInbandService.java @@ -46,12 +46,9 @@ public class CliInbandService implements RpcService<CliInbandInput, CliInbandOut @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 diff --git a/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/state/VersionCustomizer.java b/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/state/VersionCustomizer.java index bfbabcb0c..b162a39a1 100644 --- a/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/state/VersionCustomizer.java +++ b/vpp-management/impl/src/main/java/io/fd/hc2vpp/management/state/VersionCustomizer.java @@ -65,10 +65,10 @@ public final class VersionCustomizer 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)); } diff --git a/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/rpc/CliInbandServiceTest.java b/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/rpc/CliInbandServiceTest.java index dcf0a0186..2677b979b 100644 --- a/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/rpc/CliInbandServiceTest.java +++ b/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/rpc/CliInbandServiceTest.java @@ -42,7 +42,7 @@ public class CliInbandServiceTest implements FutureProducer { 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(); diff --git a/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/state/VppStateTest.java b/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/state/VppStateTest.java index 7e03d8c31..ba69f1785 100644 --- a/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/state/VppStateTest.java +++ b/vpp-management/impl/src/test/java/io/fd/hc2vpp/management/state/VppStateTest.java @@ -98,10 +98,10 @@ public class VppStateTest implements FutureProducer { 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())); |