Skip to content

Commit

Permalink
fixed #189 : removed preprint
Browse files Browse the repository at this point in the history
  • Loading branch information
baubakg committed Oct 8, 2024
1 parent ca25dd7 commit f493573
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,9 @@ You can get a print out of the command line options by running the command with
All reports are stored in the directory `log-parser-reports/export/`.

## Changelog
### 1.11.1
### 1.11.2
- [#188](https://github.com/adobe/log-parser/issues/188) We solved problems with exporting when the directory hierarchy is not present.
- [#189](https://github.com/adobe/log-parser/issues/189) The generated JSON when exporting results included unnecessary elements.

### 1.11.0
- **(new feature)** [#10](https://github.com/adobe/log-parser/issues/10) We now have an executable for the log-parser. You can perform a log parsing using the command line. For more information please read the section on [Command-line Execution of the Log-Parser](#command-line-execution-of-the-log-parser).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public File exportLogDataToJSON(Collection<String> in_headerSet, String in_jsonF

ObjectMapper objectMapper = new ObjectMapper();
objectMapper.writeValue(l_exportFile,
objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonList));
objectMapper.writeValueAsString(jsonList));
} catch (IOException e) {
throw new LogDataExportToFileException("Encountered error while exporting the log data to a JSON file.", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.adobe.campaign.tests.logparser.exceptions.LogParserSDKDefinitionException;
import com.adobe.campaign.tests.logparser.exceptions.StringParseException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.hamcrest.Matchers;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -233,7 +234,11 @@ public void testSimpleLogACC_SDK_exportDateTimeJSON() throws StringParseExceptio
ObjectMapper objectMapper = new ObjectMapper();
String values = objectMapper.readValue(l_exportedFile, String.class);

assertThat("JSON file contains correct verb definition", values.contains("\"timeStamp\" : \"2024-06-13T03:00:19.727Z\""));
assertThat("JSON file contains correct verb definition and is not prettified", values.contains("\"timeStamp\":\"2024-06-13T03:00:19.727Z\""));
assertThat("JSON file does not contain prettified elements", !values.contains("\n"));
assertThat("JSON file does not contain prettified elements", !values.contains("\t"));
boolean containsNewline = values.contains("\n");
System.out.println("Contains newline: " + containsNewline);

} finally {
l_exportedFile.delete();
Expand Down

0 comments on commit f493573

Please sign in to comment.