Skip to content

Commit

Permalink
Remove special handling via UNDEFINED ui connection param value
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennestuder committed Jun 25, 2022
1 parent 013e93a commit 7bd3913
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
@SuppressWarnings({"DuplicatedCode", "Convert2Diamond"})
public final class GradleEnterpriseParametersProvider implements BuildParametersProvider {

private static final String OVERRIDE_STRING = "UNDEFINED";

@NotNull
@Override
public Map<String, String> getParameters(@NotNull SBuild build, boolean emulationMode) {
Expand All @@ -73,9 +71,7 @@ public Map<String, String> getParameters(@NotNull SBuild build, boolean emulatio
}

private static void setParameter(String key, String value, Map<String, String> params) {
if (params.containsKey(key) && OVERRIDE_STRING.equals(value)) {
params.remove(key);
} else if (value != null) {
if (value != null) {
params.put(key, value);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,4 @@ class GradleEnterpriseParametersProviderTest extends Specification {
parameters.get(GRADLE_ENTERPRISE_URL_CONFIG_PARAM) == value
}

def "clears configuration parameter when UNDEFINED is passed"() {
given:
descriptorParams[GRADLE_ENTERPRISE_URL] = 'UNDEFINED'
higherDescriptorParams[GRADLE_ENTERPRISE_URL] = 'https://ge.example.invalid'

when:
def parameters = buildParametersProvider.getParameters(sBuild, false)

then:
parameters.get(GRADLE_ENTERPRISE_URL_CONFIG_PARAM) == null
}

}

0 comments on commit 7bd3913

Please sign in to comment.