File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
main/java/cd/go/contrib/elasticagent
test/java/cd/go/contrib/elasticagent Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public String getClusterUrl() {
108
108
}
109
109
110
110
public String getCaCertData () {
111
- return clusterCACertData ;
111
+ return isBlank ( clusterCACertData ) ? null : clusterCACertData ;
112
112
}
113
113
114
114
public Integer getClusterRequestTimeout () {
Original file line number Diff line number Diff line change @@ -98,4 +98,14 @@ public void shouldConsiderBlankStringAsNull() {
98
98
99
99
assertThat (pluginSettings .getNamespace ()).isEqualTo ("default" );
100
100
}
101
+
102
+ @ Test
103
+ public void shouldConsiderBlankCertAsNull () {
104
+ final Map <String , Object > pluginSettingsMap = new HashMap <>();
105
+ pluginSettingsMap .put ("kubernetes_cluster_ca_cert" , " " );
106
+
107
+ PluginSettings pluginSettings = PluginSettings .fromJSON (new Gson ().toJson (pluginSettingsMap ));
108
+
109
+ assertThat (pluginSettings .getCaCertData ()).isNull ();
110
+ }
101
111
}
You can’t perform that action at this time.
0 commit comments