tkobayas commented on code in PR #6064:
URL:
https://github.com/apache/incubator-kie-drools/pull/6064#discussion_r1743134752
##########
drools-util/src/test/java/org/drools/util/JarUtilsTest.java:
##########
@@ -29,4 +29,16 @@ public void normalizeSpringBootResourceUrlPath() {
String normalized =
JarUtils.normalizeSpringBootResourceUrlPath("BOOT-INF/classes!/org/example/MyClass.class");
assertThat(normalized).isEqualTo("BOOT-INF/classes/org/example/MyClass.class");
}
+
+ @Test
+ public void replaceNestedPathForSpringBoot32_shouldNotAffectOldPath() {
+ String result =
JarUtils.replaceNestedPathForSpringBoot32("/dir/myapp.jar!/BOOT-INF/lib/mykjar.jar");
+
assertThat(result).isEqualTo("/dir/myapp.jar!/BOOT-INF/lib/mykjar.jar");
+ }
+
+ @Test
+ public void replaceNestedPathForSpringBoot32_shouldReplaceNewPath() {
+ String result =
JarUtils.replaceNestedPathForSpringBoot32("/dir/myapp.jar/!BOOT-INF/lib/mykjar.jar");
+
assertThat(result).isEqualTo("/dir/myapp.jar!/BOOT-INF/lib/mykjar.jar");
+ }
Review Comment:
Added simple unit tests only.
I have manually tested with spring boot 3.2.6.
https://github.com/tkobayas/kiegroup-examples/tree/master/Ex-spring-boot-3.2-demo-main
. and confirmed that the issue is solved.
Adding such integration tests (actually build a uber jar and run it with
`ProcessBuilder`) might be worth discussing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]