@Test public void resultWithFileDoesHaveFileToDownload() { Path fileToDownload = Paths.get(".").toAbsolutePath(); CommandResult commandResult = new LegacyCommandResult(fileToDownload); assertThat(commandResult.hasFileToDownload()).isTrue(); assertThat(commandResult.nextLine()).isEqualTo(fileToDownload.toString() + LINE_SEPARATOR); assertThat(commandResult.getFileToDownload()).isEqualTo(fileToDownload); } }
private static CommandResponse prepareCommandResponse(String memberName, CommandResult result) { GfJsonObject content; content = result.getContent(); return new CommandResponse(memberName, getType(result), result.getStatus().getCode(), "1/1", CliMetaData.ANNOTATION_NULL_VALUE, getDebugInfo(), result.getHeader(), content, result.getFooter(), result.failedToPersist(), result.getFileToDownload()); }