Skip to content

Commit

Permalink
Issue #424: Add CLI options for specific query execution
Browse files Browse the repository at this point in the history
* Fixed LF & CRLF issue in a unit test.
  • Loading branch information
CherfaElyes committed Dec 27, 2024
1 parent b9a9f82 commit 40baaf7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public String getHeaderContent() throws IOException {
StringBuilder header = new StringBuilder();

if (headers != null) {
headers.forEach((key, value) -> header.append(String.format("%s: %s%s", key, value, System.lineSeparator())));
headers.forEach((key, value) -> header.append(String.format("%s: %s\n", key, value)));
return header.toString();
} else if (headerFile != null) {
header.append(Files.readString(Path.of(headerFile), StandardCharsets.UTF_8));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void testGetQuery() {
httpCli.setAuthenticationToken(AUTHENTICATION_TOKEN);

StringBuilder header = new StringBuilder();
HEADERS.forEach((key, value) -> header.append(String.format("%s: %s%s", key, value, System.lineSeparator())));
HEADERS.forEach((key, value) -> header.append(String.format("%s: %s\n", key, value)));

ObjectNode queryNode = JsonNodeFactory.instance.objectNode();
queryNode.set("method", new TextNode(HTTP_GET));
Expand All @@ -72,8 +72,7 @@ void testGetQuery() {
void testGetHeader() throws Exception {
initCli();
httpCli.setHeaders(HEADERS);
String expectedHeaderContent = String.format("Content-Type: application/xml%s", System.lineSeparator());
assertEquals(expectedHeaderContent, httpCli.getHeaderContent());
assertEquals("Content-Type: application/xml\n", httpCli.getHeaderContent());
httpCli.setHeaders(null);
httpCli.setHeaderFile(HEADER_FILE_PATH);
assertEquals(FILE_HEADER, httpCli.getHeaderContent());
Expand Down

0 comments on commit 40baaf7

Please sign in to comment.