Skip to content

Commit 82164fc

Browse files
committed
patch testbench-demo starter
1 parent 893951d commit 82164fc

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

scripts/pit/lib/lib-patch-v25.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ applyv25patches() {
2323
## TODO: needs to be documented in release notes, but also in migration guide to 25
2424
patchJaxrs $app_
2525
;;
26+
testbench-demo)
27+
## TODO: changes are already in v25, make it main branch when 25.0 GA
28+
patchTestBenchJUnit
29+
;;
2630
esac
2731
## TODO: document in migration guide to 25
2832
patchImports 'import com.fasterxml.jackson.core.type.TypeReference;' 'import tools.jackson.core.type.TypeReference;'
@@ -186,4 +190,33 @@ patchImports() {
186190
[ -z "$TEST" ] && warn "replacing $1 in $i" || cmd "## replacing $1 in $i"
187191
perl -pi -e 's|'"$1"'|'"$2"'|g' $i
188192
done
193+
}
194+
195+
patchTestBenchJUnit() {
196+
# Check if JUnit dependencies are already present
197+
if grep -q "junit-vintage-engine" pom.xml; then
198+
return 0
199+
fi
200+
[ -z "$TEST" ] && warn "adding JUnit dependencies to pom.xml" || cmd "## adding JUnit dependencies to pom.xml"
201+
block=" <dependency>
202+
<groupId>org.junit.vintage</groupId>
203+
<artifactId>junit-vintage-engine</artifactId>
204+
<version>5.13.1</version>
205+
<scope>test</scope>
206+
</dependency>
207+
<dependency>
208+
<groupId>org.junit.jupiter</groupId>
209+
<artifactId>junit-jupiter-engine</artifactId>
210+
<version>5.13.1</version>
211+
<scope>test</scope>
212+
</dependency>
213+
<dependency>
214+
<groupId>org.junit.platform</groupId>
215+
<artifactId>junit-platform-launcher</artifactId>
216+
<version>1.13.1</version>
217+
<scope>test</scope>
218+
</dependency>"
219+
_cmd="perl -0777 -pi -e 's|(\s*)</dependencies>|\$1$block\$1</dependencies>|' pom.xml"
220+
cmd "$_cmd"
221+
[ -n "$TEST" ] || eval "$_cmd"
189222
}

0 commit comments

Comments
 (0)