Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ subprojects {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")

// Source code: A category that an Error Prone check already owns is deliberately absent
options.compilerArgs.add("-Xlint:deprecation,removal,unchecked,cast,rawtypes,divzero,this-escape,identity,text-blocks,dangling-doc-comments,restricted")
// The build itself: command-line options, path entries, output file collisions
options.compilerArgs.add("-Xlint:options,path,output-file-clash")

options.errorprone {
// The checks live in errorprone.args, see https://github.com/tbroyer/gradle-errorprone-plugin#argument-files
argumentFiles.from(rootProject.layout.projectDirectory.file("errorprone.args"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ void setUp() {
resource.setSpec(spec);
resource.setMetadata(metadata);

//noinspection unchecked
context = mock(Context.class);
context = mock();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ private void createTableWithSerial(
) {
try (var dsl = postgreSQLContextFactory.getDSLContext(clusterConnection, databaseName)) {
dsl.createTable(quotedName(schemaName, tableName))
.column("id", SQLDataType.BIGINT.identity(true))
.column("id", SQLDataType.BIGINT.generatedByDefaultAsIdentity())
.execute();
}
}
Expand Down
30 changes: 16 additions & 14 deletions operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package it.aboutbits.postgresql.helm;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import io.fabric8.kubernetes.api.model.ConfigBuilder;
import io.fabric8.kubernetes.api.model.LocalObjectReference;
import io.fabric8.kubernetes.api.model.Volume;
Expand Down Expand Up @@ -83,22 +85,20 @@

// 1. Verify files exist and contain expected data
// ./Chart.yaml
@SuppressWarnings("unchecked")
Map<String, Object> chartMetadata = Serialization.yamlMapper()
.readValue(
chartPath.resolve("Chart.yaml").toFile(),
Map.class
);
Map<String, Object> chartMetadata = Serialization.unmarshal(

Check warning on line 88 in operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

View workflow job for this annotation

GitHub Actions / Tests / Tests (PostgreSQL 17)

[deprecation] <T>unmarshal(InputStream,TypeReference<T>) in Serialization has been deprecated

Check warning on line 88 in operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

View workflow job for this annotation

GitHub Actions / Tests / Tests (PostgreSQL 15)

[deprecation] <T>unmarshal(InputStream,TypeReference<T>) in Serialization has been deprecated

Check warning on line 88 in operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

View workflow job for this annotation

GitHub Actions / Tests / Tests (PostgreSQL 18)

[deprecation] <T>unmarshal(InputStream,TypeReference<T>) in Serialization has been deprecated
Files.newInputStream(chartPath.resolve("Chart.yaml")),
new TypeReference<Map<String, Object>>() {
}
);

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

// ./values.yaml
@SuppressWarnings("unchecked")
Map<String, Object> values = Serialization.yamlMapper()
.readValue(
chartPath.resolve("values.yaml").toFile(),
Map.class
);
Map<String, Object> values = Serialization.unmarshal(

Check warning on line 97 in operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

View workflow job for this annotation

GitHub Actions / Tests / Tests (PostgreSQL 17)

[deprecation] <T>unmarshal(InputStream,TypeReference<T>) in Serialization has been deprecated

Check warning on line 97 in operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

View workflow job for this annotation

GitHub Actions / Tests / Tests (PostgreSQL 15)

[deprecation] <T>unmarshal(InputStream,TypeReference<T>) in Serialization has been deprecated

Check warning on line 97 in operator/src/test/java/it/aboutbits/postgresql/helm/HelmTest.java

View workflow job for this annotation

GitHub Actions / Tests / Tests (PostgreSQL 18)

[deprecation] <T>unmarshal(InputStream,TypeReference<T>) in Serialization has been deprecated
Files.newInputStream(chartPath.resolve("values.yaml")),
new TypeReference<Map<String, Object>>() {
}
);

assertThat(values).containsKey(rootValuesAlias);

Expand All @@ -123,8 +123,10 @@
// ./values.schema.json
// The type must be declared for every list value, otherwise the generated schema
// falls back to `string` and `helm install` rejects a list.
var valuesSchema = Serialization.jsonMapper()
.readTree(chartPath.resolve("values.schema.json").toFile());
var valuesSchema = Serialization.unmarshal(
Files.newInputStream(chartPath.resolve("values.schema.json")),
JsonNode.class
);

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