Skip to content

Commit

Permalink
Reintroduced the proper test
Browse files Browse the repository at this point in the history
  • Loading branch information
baubakg committed Oct 14, 2024
1 parent 9351df3 commit 72466f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ All reports are stored in the directory `log-parser-reports/export/`.
- [#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 escape characters.


### 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).
- **(new feature)** [#127](https://github.com/adobe/log-parser/issues/127) You can now compare two LogData Objects. This is a light compare that checks that for a given key, if it is absent, added or changes in frequency.
Expand All @@ -492,7 +491,6 @@ All reports are stored in the directory `log-parser-reports/export/`.
- [#137](https://github.com/adobe/log-parser/issues/137) We can now generate an HTML report for the differences in log data.
- [#185](https://github.com/adobe/log-parser/issues/185) Resolved issue with deserializing unexpected objects in SDK Log entries..


### 1.0.10
- Moved main code and tests to the package "core"
- [#67](https://github.com/adobe/log-parser/issues/67) We can now select the files using a wild card. Given a directory we can now look for files in the sub-directory given a wild-card. The wildcards are implemented using Adobe Commons IO. You can read more on this in the [WildcardFilter JavaDoc](https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/filefilter/WildcardFilter.html)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.time.ZonedDateTime;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -233,15 +234,16 @@ public void testSimpleLogACC_SDK_exportDateTimeJSON() throws StringParseExceptio
assertThat("Created JSON file is no Empty", l_exportedFile.length() > 0);

try {
String content = Files.readString(l_exportedFile.toPath());

ObjectMapper objectMapper = new ObjectMapper();
List<Map<String, String>> values = objectMapper.readValue(l_exportedFile, List.class);

assertThat("JSON file contains correct verb definition", values.get(0).keySet().contains("timeStamp"));
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);
assertThat("JSON file contains correct verb definition and is not prettified", content.contains("\"timeStamp\":\"2024-06-13T03:00:19.727Z\""));
assertThat("JSON file does not contain prettified elements", !content.contains("\n"));
assertThat("JSON file does not contain prettified elements", !content.contains("\t"));
assertThat("JSON file does not contain prettified elements", !content.contains("\\"));

} finally {
l_exportedFile.delete();
Expand Down

0 comments on commit 72466f4

Please sign in to comment.