Skip to content

Commit 717e5c9

Browse files
committed
fix deprecation warnings
1 parent 1672b02 commit 717e5c9

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

operator/src/test/java/it/aboutbits/postgresql/crd/grant/GrantReconcilerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ private void createTableWithSerial(
12941294
) {
12951295
try (var dsl = postgreSQLContextFactory.getDSLContext(clusterConnection, databaseName)) {
12961296
dsl.createTable(quotedName(schemaName, tableName))
1297-
.column("id", SQLDataType.BIGINT.identity(true))
1297+
.column("id", SQLDataType.BIGINT.generatedByDefaultAsIdentity())
12981298
.execute();
12991299
}
13001300
}

operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package it.aboutbits.postgresql.helm;
22

3+
import com.fasterxml.jackson.databind.JsonNode;
34
import io.fabric8.kubernetes.api.model.ConfigBuilder;
45
import io.fabric8.kubernetes.api.model.LocalObjectReference;
56
import io.fabric8.kubernetes.api.model.Volume;
67
import io.fabric8.kubernetes.api.model.VolumeMount;
78
import io.fabric8.kubernetes.api.model.apps.Deployment;
89
import io.fabric8.kubernetes.client.KubernetesClient;
10+
import io.fabric8.kubernetes.client.utils.KubernetesSerialization;
911
import io.fabric8.kubernetes.client.utils.Serialization;
1012
import io.quarkus.test.junit.QuarkusTest;
1113
import io.smallrye.common.process.ProcessBuilder;
@@ -35,6 +37,7 @@
3537
@NullMarked
3638
class HelmTest {
3739
private static final String ENV_VAR_KUBECONFIG = "KUBECONFIG";
40+
private static final KubernetesSerialization KUBERNETES_SERIALIZATION = new KubernetesSerialization();
3841

3942
/// The Pod and Container list fields that the chart exposes as free-form Helm values.
4043
private static final List<String> LIST_VALUES = List.of(
@@ -84,21 +87,19 @@ void helmInstall_createsDeployment() throws IOException {
8487
// 1. Verify files exist and contain expected data
8588
// ./Chart.yaml
8689
@SuppressWarnings("unchecked")
87-
Map<String, Object> chartMetadata = Serialization.yamlMapper()
88-
.readValue(
89-
chartPath.resolve("Chart.yaml").toFile(),
90-
Map.class
91-
);
90+
Map<String, Object> chartMetadata = KUBERNETES_SERIALIZATION.unmarshal(
91+
Files.newInputStream(chartPath.resolve("Chart.yaml")),
92+
Map.class
93+
);
9294

9395
assertThat(chartMetadata.get("name")).isEqualTo(chartName);
9496

9597
// ./values.yaml
9698
@SuppressWarnings("unchecked")
97-
Map<String, Object> values = Serialization.yamlMapper()
98-
.readValue(
99-
chartPath.resolve("values.yaml").toFile(),
100-
Map.class
101-
);
99+
Map<String, Object> values = KUBERNETES_SERIALIZATION.unmarshal(
100+
Files.newInputStream(chartPath.resolve("values.yaml")),
101+
Map.class
102+
);
102103

103104
assertThat(values).containsKey(rootValuesAlias);
104105

@@ -123,8 +124,10 @@ void helmInstall_createsDeployment() throws IOException {
123124
// ./values.schema.json
124125
// The type must be declared for every list value, otherwise the generated schema
125126
// falls back to `string` and `helm install` rejects a list.
126-
var valuesSchema = Serialization.jsonMapper()
127-
.readTree(chartPath.resolve("values.schema.json").toFile());
127+
var valuesSchema = KUBERNETES_SERIALIZATION.unmarshal(
128+
Files.newInputStream(chartPath.resolve("values.schema.json")),
129+
JsonNode.class
130+
);
128131

129132
for (var listValue : LIST_VALUES) {
130133
var schemaProperty = valuesSchema.at("/properties/%s/properties/%s".formatted(

0 commit comments

Comments
 (0)