adapt to string type changes in JVPP 73/16473/1
authorMichal Cmarada <[email protected]>
Fri, 14 Dec 2018 08:39:12 +0000 (09:39 +0100)
committerMichal Cmarada <[email protected]>
Fri, 14 Dec 2018 08:39:12 +0000 (09:39 +0100)
Change-Id: Ic3a01740290a2af37c495318f2aa5422f5fe06cd
Signed-off-by: Michal Cmarada <[email protected]>
vpp-management/impl/src/main/java/io/fd/hc2vpp/management/rpc/CliInbandService.java
vpp-management/impl/src/main/java/io/fd/hc2vpp/management/state/VersionCustomizer.java
vpp-management/impl/src/test/java/io/fd/hc2vpp/management/rpc/CliInbandServiceTest.java
vpp-management/impl/src/test/java/io/fd/hc2vpp/management/state/VppStateTest.java

index ab55abe..fd1b18e 100644 (file)
@@ -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
index bfbabcb..b162a39 100644 (file)
@@ -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));
     }
 
index dcf0a01..2677b97 100644 (file)
@@ -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();
index 7e03d8c..ba69f17 100644 (file)
@@ -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()));