adobe / aem-core-cif-components

A set of configurations and components to get you started with AEM Commerce development
Apache License 2.0
103 stars 80 forks source link

Windows | Build failing at junits #880

Open nishneo opened 2 years ago

nishneo commented 2 years ago

Expected Behaviour

Build should be successful

Actual Behaviour

Build fail at junits

Reproduce Scenario (including but not limited to)

mvn clean install at master branch for 2.7.1-SNAPSHOT

Steps to Reproduce

Checkout code and build using mvn clean install

Platform and Version

Windows

Logs taken while reproducing problem

ERROR] Errors: [ERROR] CommerceLinksTransformerTest.testTransformerDisabled:158 ▒ InvalidPath Illegal... [INFO] [ERROR] Tests run: 626, Failures: 0, Errors: 1, Skipped: 0 [INFO]

17:18:04.761 [main] INFO c.a.c.c.c.c.i.s.CommerceLinksTransformerFactory - Commerce links transformer enabled. 17:18:05.095 [main] INFO c.a.c.c.c.c.i.s.CommerceLinksTransformerFactory - Commerce links transformer disabled. [ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.477 s <<< FAILURE! - in com.adobe.cq.commerce.core.components.internal.services.CommerceLinksTransformerTest [ERROR] testTransformerDisabled(com.adobe.cq.commerce.core.components.internal.services.CommerceLinksTransformerTest) Time elapsed: 0.22 s <<< ERROR! java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/anupatel/Desktop/Unilever/cif-core-components/aem-core-cif-components/bundles/core/target/test-classes/rewriter/ciflinks.html at com.adobe.cq.commerce.core.components.internal.services.CommerceLinksTransformerTest.testTransformerDisabled(CommerceLinksTransformerTest.java:158)

buuhuu commented 2 years ago

This would require inlining the html from the ciflinks.html into the java class. Please feel free to provide a pull request for this.

kkaushik2002 commented 2 years ago

@Buuhuu I have gone through the code base of java. can you please help me with changes.. // verify transformed HTML String transformedHtml = writer.toString();

    Path filePath = Paths.get(classLoader.getResource(TEST_HTML).getPath());

    String originalHtml = Files.lines(filePath).collect(Collectors.joining(System.lineSeparator()));

    assertTrue(transformedHtml.endsWith(originalHtml));

Thanks,