Skip to content

Extract RestEasy json body response schemas #9015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: alejandro.gonzalez/api-sec-jersey-response-schema
Choose a base branch
from

Conversation

jandro996
Copy link
Member

What Does This Do

Adds smoke test to probe that response body extraction for RestEasy JSON endpoints to enable automatic API schema discovery and protection by the Web Application Firewall (WAF) was covered with the instrumentation done in #9014

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@jandro996 jandro996 added type: enhancement comp: asm waf Application Security Management (WAF) labels Jun 20, 2025
@pr-commenter
Copy link

pr-commenter bot commented Jun 20, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alejandro.gonzalez/api-sec-resteasy-response-schema
git_commit_date 1750407702 1750414325
git_commit_sha 6db7d82 f88d1cf
release_version 1.50.0-SNAPSHOT~6db7d82c6e 1.50.0-SNAPSHOT~f88d1cfe49
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1750416129 1750416129
ci_job_id 990978774 990978774
ci_pipeline_id 68295119 68295119
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-z-gvyqhn-project-304-concurrent-3-pyfrcddy 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-z-gvyqhn-project-304-concurrent-3-pyfrcddy 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 1 performance regressions! Performance is the same for 43 metrics, 9 unstable metrics.

scenario Δ mean execution_time candidate mean execution_time baseline mean execution_time
scenario:startup:petclinic:profiling:AppSec worse
[+2.189ms; +3.203ms] or [+3.539%; +5.178%]
64.551ms 61.855ms
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.031 s) : 0, 1030501
Total [baseline] (10.605 s) : 0, 10604539
Agent [candidate] (1.034 s) : 0, 1033924
Total [candidate] (10.514 s) : 0, 10513929
section appsec
Agent [baseline] (1.179 s) : 0, 1179476
Total [baseline] (10.736 s) : 0, 10736161
Agent [candidate] (1.178 s) : 0, 1177601
Total [candidate] (10.674 s) : 0, 10673903
section iast
Agent [baseline] (1.155 s) : 0, 1154596
Total [baseline] (10.953 s) : 0, 10953194
Agent [candidate] (1.161 s) : 0, 1160514
Total [candidate] (10.851 s) : 0, 10851143
section profiling
Agent [baseline] (1.265 s) : 0, 1264857
Total [baseline] (10.969 s) : 0, 10968525
Agent [candidate] (1.271 s) : 0, 1270935
Total [candidate] (10.862 s) : 0, 10861676
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.031 s -
Agent appsec 1.179 s 148.975 ms (14.5%)
Agent iast 1.155 s 124.096 ms (12.0%)
Agent profiling 1.265 s 234.356 ms (22.7%)
Total tracing 10.605 s -
Total appsec 10.736 s 131.623 ms (1.2%)
Total iast 10.953 s 348.655 ms (3.3%)
Total profiling 10.969 s 363.987 ms (3.4%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.034 s -
Agent appsec 1.178 s 143.677 ms (13.9%)
Agent iast 1.161 s 126.59 ms (12.2%)
Agent profiling 1.271 s 237.011 ms (22.9%)
Total tracing 10.514 s -
Total appsec 10.674 s 159.974 ms (1.5%)
Total iast 10.851 s 337.214 ms (3.2%)
Total profiling 10.862 s 347.747 ms (3.3%)
gantt
    title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (689.387 ms) : 0, 689387
BytebuddyAgent [candidate] (688.264 ms) : 0, 688264
GlobalTracer [baseline] (242.67 ms) : 0, 242670
GlobalTracer [candidate] (241.993 ms) : 0, 241993
AppSec [baseline] (59.982 ms) : 0, 59982
AppSec [candidate] (61.115 ms) : 0, 61115
Debugger [baseline] (7.744 ms) : 0, 7744
Debugger [candidate] (6.248 ms) : 0, 6248
Remote Config [baseline] (679.37 µs) : 0, 679
Remote Config [candidate] (672.824 µs) : 0, 673
Telemetry [baseline] (8.989 ms) : 0, 8989
Telemetry [candidate] (11.901 ms) : 0, 11901
section appsec
BytebuddyAgent [baseline] (711.553 ms) : 0, 711553
BytebuddyAgent [candidate] (704.666 ms) : 0, 704666
GlobalTracer [baseline] (235.741 ms) : 0, 235741
GlobalTracer [candidate] (234.524 ms) : 0, 234524
IAST [baseline] (21.83 ms) : 0, 21830
IAST [candidate] (21.744 ms) : 0, 21744
AppSec [baseline] (175.652 ms) : 0, 175652
AppSec [candidate] (179.611 ms) : 0, 179611
Debugger [baseline] (5.939 ms) : 0, 5939
Debugger [candidate] (5.819 ms) : 0, 5819
Remote Config [baseline] (608.108 µs) : 0, 608
Remote Config [candidate] (636.657 µs) : 0, 637
Telemetry [baseline] (7.233 ms) : 0, 7233
Telemetry [candidate] (7.155 ms) : 0, 7155
section iast
BytebuddyAgent [baseline] (808.195 ms) : 0, 808195
BytebuddyAgent [candidate] (807.515 ms) : 0, 807515
GlobalTracer [baseline] (232.415 ms) : 0, 232415
GlobalTracer [candidate] (232.288 ms) : 0, 232288
IAST [baseline] (25.939 ms) : 0, 25939
IAST [candidate] (27.779 ms) : 0, 27779
AppSec [baseline] (52.612 ms) : 0, 52612
AppSec [candidate] (54.699 ms) : 0, 54699
Debugger [baseline] (5.915 ms) : 0, 5915
Debugger [candidate] (6.048 ms) : 0, 6048
Remote Config [baseline] (594.154 µs) : 0, 594
Remote Config [candidate] (615.525 µs) : 0, 616
Telemetry [baseline] (8.012 ms) : 0, 8012
Telemetry [candidate] (8.021 ms) : 0, 8021
section profiling
BytebuddyAgent [baseline] (674.212 ms) : 0, 674212
BytebuddyAgent [candidate] (674.607 ms) : 0, 674607
GlobalTracer [baseline] (359.766 ms) : 0, 359766
GlobalTracer [candidate] (358.947 ms) : 0, 358947
AppSec [baseline] (61.855 ms) : 0, 61855
AppSec [candidate] (64.551 ms) : 0, 64551
Debugger [baseline] (6.12 ms) : 0, 6120
Debugger [candidate] (6.24 ms) : 0, 6240
Remote Config [baseline] (702.836 µs) : 0, 703
Remote Config [candidate] (685.795 µs) : 0, 686
Telemetry [baseline] (8.12 ms) : 0, 8120
Telemetry [candidate] (8.214 ms) : 0, 8214
ProfilingAgent [baseline] (105.679 ms) : 0, 105679
ProfilingAgent [candidate] (107.005 ms) : 0, 107005
Profiling [baseline] (105.704 ms) : 0, 105704
Profiling [candidate] (107.03 ms) : 0, 107030
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.032 s) : 0, 1031598
Total [baseline] (8.562 s) : 0, 8561689
Agent [candidate] (1.027 s) : 0, 1026634
Total [candidate] (8.561 s) : 0, 8561367
section iast
Agent [baseline] (1.148 s) : 0, 1148092
Total [baseline] (9.19 s) : 0, 9189649
Agent [candidate] (1.152 s) : 0, 1151775
Total [candidate] (9.201 s) : 0, 9201419
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.032 s -
Agent iast 1.148 s 116.494 ms (11.3%)
Total tracing 8.562 s -
Total iast 9.19 s 627.96 ms (7.3%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.027 s -
Agent iast 1.152 s 125.14 ms (12.2%)
Total tracing 8.561 s -
Total iast 9.201 s 640.052 ms (7.5%)
gantt
    title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (690.34 ms) : 0, 690340
BytebuddyAgent [candidate] (683.657 ms) : 0, 683657
GlobalTracer [baseline] (243.282 ms) : 0, 243282
GlobalTracer [candidate] (240.35 ms) : 0, 240350
AppSec [baseline] (59.46 ms) : 0, 59460
AppSec [candidate] (58.864 ms) : 0, 58864
Debugger [baseline] (6.296 ms) : 0, 6296
Debugger [candidate] (6.255 ms) : 0, 6255
Remote Config [baseline] (674.112 µs) : 0, 674
Remote Config [candidate] (673.944 µs) : 0, 674
Telemetry [baseline] (10.591 ms) : 0, 10591
Telemetry [candidate] (13.476 ms) : 0, 13476
section iast
BytebuddyAgent [baseline] (803.345 ms) : 0, 803345
BytebuddyAgent [candidate] (801.42 ms) : 0, 801420
GlobalTracer [baseline] (231.098 ms) : 0, 231098
GlobalTracer [candidate] (230.589 ms) : 0, 230589
IAST [baseline] (26.57 ms) : 0, 26570
IAST [candidate] (29.422 ms) : 0, 29422
AppSec [baseline] (51.837 ms) : 0, 51837
AppSec [candidate] (52.51 ms) : 0, 52510
Debugger [baseline] (5.92 ms) : 0, 5920
Debugger [candidate] (5.955 ms) : 0, 5955
Remote Config [baseline] (594.888 µs) : 0, 595
Remote Config [candidate] (586.095 µs) : 0, 586
Telemetry [baseline] (7.998 ms) : 0, 7998
Telemetry [candidate] (7.929 ms) : 0, 7929
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-06-20T10:26:49 2025-06-20T10:36:46
git_branch master alejandro.gonzalez/api-sec-resteasy-response-schema
git_commit_date 1750407702 1750414325
git_commit_sha 6db7d82 f88d1cf
release_version 1.50.0-SNAPSHOT~6db7d82c6e 1.50.0-SNAPSHOT~f88d1cfe49
start_time 2025-06-20T10:26:17 2025-06-20T10:34:07
See matching parameters
Baseline Candidate
application petclinic petclinic
ci_job_date 1750415807 1750415807
ci_job_id 990978775 990978775
ci_pipeline_id 68295119 68295119
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-4rcvxfax-project-304-concurrent-1-cmejo615 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-4rcvxfax-project-304-concurrent-1-cmejo615 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
thresholds_or_results results results
variant appsec appsec

Summary

Found 6 performance improvements and 0 performance regressions! Performance is the same for 0 metrics, 6 unstable metrics.

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:petclinic:appsec better
[-63.674ms; -62.114ms] or [-87.146%; -85.011%]
unstable
[+398.051op/s; +444.602op/s] or [+591.964%; +661.193%]
10.172ms 488.569op/s 73.066ms 67.242op/s
scenario:load:petclinic:code_origins better
[-45.715ms; -42.765ms] or [-51.671%; -48.337%]
unstable
[+25.252op/s; +67.582op/s] or [+48.175%; +128.932%]
44.234ms 98.833op/s 88.474ms 52.417op/s
scenario:load:petclinic:iast better
[-45.945ms; -43.906ms] or [-56.814%; -54.293%]
unstable
[+49.929op/s; +84.296op/s] or [+81.305%; +137.270%]
35.943ms 128.522op/s 80.869ms 61.409op/s
scenario:load:petclinic:no_agent better
[-4.235ms; -4.061ms] or [-34.614%; -33.190%]
unstable
[+175.279op/s; +235.364op/s] or [+43.240%; +58.062%]
8.088ms 610.687op/s 12.236ms 405.365op/s
scenario:load:petclinic:profiling better
[-56.794ms; -55.449ms] or [-88.997%; -86.889%]
unstable
[+548.900op/s; +579.945op/s] or [+726.271%; +767.348%]
7.694ms 640.000op/s 63.816ms 75.578op/s
scenario:load:petclinic:tracing better
[-45.983ms; -44.770ms] or [-86.048%; -83.779%]
unstable
[+503.605op/s; +534.641op/s] or [+550.006%; +583.901%]
8.062ms 610.687op/s 53.438ms 91.564op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
    dateFormat X
    axisFormat %s
section baseline
no_agent (12.236 ms) : 12124, 12348
.   : milestone, 12236,
appsec (73.066 ms) : 72042, 74089
.   : milestone, 73066,
code_origins (88.474 ms) : 86570, 90377
.   : milestone, 88474,
iast (80.869 ms) : 79579, 82159
.   : milestone, 80869,
profiling (63.816 ms) : 62932, 64699
.   : milestone, 63816,
tracing (53.438 ms) : 52642, 54235
.   : milestone, 53438,
section candidate
no_agent (8.088 ms) : 8065, 8111
.   : milestone, 8088,
appsec (10.172 ms) : 10116, 10227
.   : milestone, 10172,
code_origins (44.234 ms) : 43868, 44599
.   : milestone, 44234,
iast (35.943 ms) : 35581, 36306
.   : milestone, 35943,
profiling (7.694 ms) : 7665, 7724
.   : milestone, 7694,
tracing (8.062 ms) : 8036, 8088
.   : milestone, 8062,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 12.236 ms [12.124 ms, 12.348 ms] -
appsec 73.066 ms [72.042 ms, 74.089 ms] 60.829 ms (497.1%)
code_origins 88.474 ms [86.57 ms, 90.377 ms] 76.237 ms (623.0%)
iast 80.869 ms [79.579 ms, 82.159 ms] 68.633 ms (560.9%)
profiling 63.816 ms [62.932 ms, 64.699 ms] 51.58 ms (421.5%)
tracing 53.438 ms [52.642 ms, 54.235 ms] 41.202 ms (336.7%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 8.088 ms [8.065 ms, 8.111 ms] -
appsec 10.172 ms [10.116 ms, 10.227 ms] 2.084 ms (25.8%)
code_origins 44.234 ms [43.868 ms, 44.599 ms] 36.146 ms (446.9%)
iast 35.943 ms [35.581 ms, 36.306 ms] 27.855 ms (344.4%)
profiling 7.694 ms [7.665 ms, 7.724 ms] -393.566 µs (-4.9%)
tracing 8.062 ms [8.036 ms, 8.088 ms] -25.864 µs (-0.3%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master alejandro.gonzalez/api-sec-resteasy-response-schema
git_commit_date 1750407702 1750414325
git_commit_sha 6db7d82 f88d1cf
release_version 1.50.0-SNAPSHOT~6db7d82c6e 1.50.0-SNAPSHOT~f88d1cfe49
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1750416350 1750416350
ci_job_id 990978776 990978776
ci_pipeline_id 68295119 68295119
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-z-gvyqhn-project-304-concurrent-4-ru77u8gk 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-z-gvyqhn-project-304-concurrent-4-ru77u8gk 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.484 ms) : 1472, 1495
.   : milestone, 1484,
appsec (2.407 ms) : 2358, 2456
.   : milestone, 2407,
iast (2.194 ms) : 2133, 2255
.   : milestone, 2194,
iast_GLOBAL (2.233 ms) : 2171, 2295
.   : milestone, 2233,
profiling (2.034 ms) : 1984, 2084
.   : milestone, 2034,
tracing (2.006 ms) : 1959, 2054
.   : milestone, 2006,
section candidate
no_agent (1.476 ms) : 1465, 1488
.   : milestone, 1476,
appsec (2.403 ms) : 2354, 2452
.   : milestone, 2403,
iast (2.196 ms) : 2134, 2258
.   : milestone, 2196,
iast_GLOBAL (2.236 ms) : 2174, 2299
.   : milestone, 2236,
profiling (2.026 ms) : 1977, 2076
.   : milestone, 2026,
tracing (2.01 ms) : 1962, 2058
.   : milestone, 2010,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.484 ms [1.472 ms, 1.495 ms] -
appsec 2.407 ms [2.358 ms, 2.456 ms] 923.667 µs (62.3%)
iast 2.194 ms [2.133 ms, 2.255 ms] 710.232 µs (47.9%)
iast_GLOBAL 2.233 ms [2.171 ms, 2.295 ms] 749.413 µs (50.5%)
profiling 2.034 ms [1.984 ms, 2.084 ms] 550.665 µs (37.1%)
tracing 2.006 ms [1.959 ms, 2.054 ms] 522.549 µs (35.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.476 ms [1.465 ms, 1.488 ms] -
appsec 2.403 ms [2.354 ms, 2.452 ms] 926.125 µs (62.7%)
iast 2.196 ms [2.134 ms, 2.258 ms] 719.25 µs (48.7%)
iast_GLOBAL 2.236 ms [2.174 ms, 2.299 ms] 759.855 µs (51.5%)
profiling 2.026 ms [1.977 ms, 2.076 ms] 549.885 µs (37.2%)
tracing 2.01 ms [1.962 ms, 2.058 ms] 533.288 µs (36.1%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.50.0-SNAPSHOT~f88d1cfe49, baseline=1.50.0-SNAPSHOT~6db7d82c6e
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.565 s) : 15565000, 15565000
.   : milestone, 15565000,
appsec (14.714 s) : 14714000, 14714000
.   : milestone, 14714000,
iast (18.461 s) : 18461000, 18461000
.   : milestone, 18461000,
iast_GLOBAL (17.729 s) : 17729000, 17729000
.   : milestone, 17729000,
profiling (15.708 s) : 15708000, 15708000
.   : milestone, 15708000,
tracing (14.841 s) : 14841000, 14841000
.   : milestone, 14841000,
section candidate
no_agent (15.537 s) : 15537000, 15537000
.   : milestone, 15537000,
appsec (14.781 s) : 14781000, 14781000
.   : milestone, 14781000,
iast (18.925 s) : 18925000, 18925000
.   : milestone, 18925000,
iast_GLOBAL (17.974 s) : 17974000, 17974000
.   : milestone, 17974000,
profiling (15.759 s) : 15759000, 15759000
.   : milestone, 15759000,
tracing (15.079 s) : 15079000, 15079000
.   : milestone, 15079000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.565 s [15.565 s, 15.565 s] -
appsec 14.714 s [14.714 s, 14.714 s] -851.0 ms (-5.5%)
iast 18.461 s [18.461 s, 18.461 s] 2.896 s (18.6%)
iast_GLOBAL 17.729 s [17.729 s, 17.729 s] 2.164 s (13.9%)
profiling 15.708 s [15.708 s, 15.708 s] 143.0 ms (0.9%)
tracing 14.841 s [14.841 s, 14.841 s] -724.0 ms (-4.7%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.537 s [15.537 s, 15.537 s] -
appsec 14.781 s [14.781 s, 14.781 s] -756.0 ms (-4.9%)
iast 18.925 s [18.925 s, 18.925 s] 3.388 s (21.8%)
iast_GLOBAL 17.974 s [17.974 s, 17.974 s] 2.437 s (15.7%)
profiling 15.759 s [15.759 s, 15.759 s] 222.0 ms (1.4%)
tracing 15.079 s [15.079 s, 15.079 s] -458.0 ms (-2.9%)

Comment on lines +16 to +28
String jarPath = System.getProperty("datadog.smoketest.resteasy.jar.path")

List<String> command = new ArrayList<>()
command.add(javaPath())
command.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
command.addAll(defaultJavaProperties)
command.addAll(defaultAppSecProperties)
if (Platform.isJavaVersionAtLeast(17)) {
command.addAll(["--add-opens", "java.base/java.lang=ALL-UNNAMED"])
}
command.addAll(["-jar", jarPath, Integer.toString(httpPort)])
ProcessBuilder processBuilder = new ProcessBuilder(command)
processBuilder.directory(new File(buildDirectory))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion, this code can be more groovy:

Suggested change
String jarPath = System.getProperty("datadog.smoketest.resteasy.jar.path")
List<String> command = new ArrayList<>()
command.add(javaPath())
command.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005")
command.addAll(defaultJavaProperties)
command.addAll(defaultAppSecProperties)
if (Platform.isJavaVersionAtLeast(17)) {
command.addAll(["--add-opens", "java.base/java.lang=ALL-UNNAMED"])
}
command.addAll(["-jar", jarPath, Integer.toString(httpPort)])
ProcessBuilder processBuilder = new ProcessBuilder(command)
processBuilder.directory(new File(buildDirectory))
def jarPath = System.getProperty('datadog.smoketest.resteasy.jar.path')
def command = [
javaPath(),
'-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005',
*defaultJavaProperties,
*defaultAppSecProperties
]
if (Platform.javaVersion >= 17) {
command += ['--add-opens', 'java.base/java.lang=ALL-UNNAMED']
}
command += ['-jar', jarPath, "$httpPort"]
new ProcessBuilder(command).tap {
directory = new File(buildDirectory)
}

@@ -10,6 +11,8 @@ public class App extends Application {

public App() {
singletons.add(new Resource());
singletons.add(new org.jboss.resteasy.plugins.providers.StringTextStar()); // Writer for String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Any reason to have fully qualified name here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: asm waf Application Security Management (WAF) type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants