Skip to content

Commit

Permalink
fix: package and simulation ID from system props, closes HYB-690
Browse files Browse the repository at this point in the history
Motivation:
Cast exception when setting package or simulation ID from system props.

Modification:
Use `UUID.fromString` when package or simulation ID is compute from system props.
  • Loading branch information
tpetillot authored and slandelle committed Jul 5, 2024
1 parent 36d7057 commit 96f1fa9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/groovy/io/gatling/gradle/GatlingPluginExtension.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class GatlingPluginExtension {
@Input
@Optional
UUID getSimulationId() {
simulationId ?: System.getProperty(SIMULATION_ID_PROPERTY) ?: null
def sysProp = System.getProperty(SIMULATION_ID_PROPERTY)
return simulationId ?: (sysProp ? UUID.fromString(sysProp) : null)
}

@Input
Expand Down Expand Up @@ -163,7 +164,8 @@ class GatlingPluginExtension {
@Input
@Optional
UUID getPackageId() {
packageId ?: System.getProperty(PACKAGE_ID_PROPERTY) ?: null
def sysProp = System.getProperty(PACKAGE_ID_PROPERTY)
return packageId ?: (sysProp ? UUID.fromString(sysProp) : null)
}

@Input
Expand All @@ -188,13 +190,7 @@ class GatlingPluginExtension {
@Optional
URL getControlPlaneUrl() {
def sysProp = System.getProperty(CONTROL_PLANE_URL)
if (controlPlaneUrl != null) {
return controlPlaneUrl
} else if (sysProp != null && sysProp != ""){
return new URL(sysProp)
} else {
return null
}
return controlPlaneUrl ?: (sysProp ? new URL(sysProp) : null)
}

@Input
Expand Down

0 comments on commit 96f1fa9

Please sign in to comment.