GetConfigCommand withSortOrder();
GetConfigCommand withExpertFlag();
GetConfigCommand withForceWriteFlag();
+ GetConfigCommand withShortDescription();
}
private final AtomicBoolean withSortOrder = new AtomicBoolean();
private final AtomicBoolean withExpertFlag = new AtomicBoolean();
private final AtomicBoolean withForceWriteFlag = new AtomicBoolean();
+ private final AtomicBoolean withShortDescription = new AtomicBoolean();
public GetConfigCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) {
this.threadPool = MoreExecutors.listeningDecorator(threadPool);
}
@Override
+ public GetConfigCommand withShortDescription() {
+ withShortDescription.set(true);
+ return this;
+ }
+
+ @Override
public ListenableFuture<ConfigData> execute() {
return threadPool.submit(this::executeDialog);
}
getConfig.setWithSortOrder(withSortOrder.get());
getConfig.setWithExpertFlag(withExpertFlag.get());
getConfig.setWithForceWriteFlag(withForceWriteFlag.get());
+ getConfig.setWithShortDescription(withShortDescription.get());
try (GetConfigDialog getConfigDialog = new GetConfigDialog()) {
return getConfigDialog.send(getConfig).get();
}
assertThat(configData.get().getForceWriteFlag("foo"), is(true));
}
+ @Test
+ public void defaultFcpClientCanGetConfigWithShortDescription()
+ throws InterruptedException, ExecutionException, IOException {
+ Future<ConfigData> configData = fcpClient.getConfig().withShortDescription().execute();
+ connectNode();
+ List<String> lines = fcpServer.collectUntil(is("EndMessage"));
+ String identifier = extractIdentifier(lines);
+ assertThat(lines, matchesFcpMessage(
+ "GetConfig",
+ "Identifier=" + identifier,
+ "WithShortDescription=true",
+ "EndMessage"
+ ));
+ fcpServer.writeLine(
+ "ConfigData",
+ "Identifier=" + identifier,
+ "shortDescription.foo=bar",
+ "EndMessage"
+ );
+ assertThat(configData.get().getShortDescription("foo"), is("bar"));
+ }
+
}