Skip to content
Merged
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
4 changes: 4 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ lombok.addNullAnnotations = jspecify

# Required for NullAway
lombok.addLombokGeneratedAnnotation = true

# Copy CDI qualifiers and config injection to the generated constructor, so @RequiredArgsConstructor works for them
lombok.copyableAnnotations += org.eclipse.microprofile.config.inject.ConfigProperty
lombok.copyableAnnotations += org.eclipse.microprofile.health.Readiness
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ public class PasswordFingerprintService {

private final KubernetesClient kubernetesClient;

@SuppressWarnings("NullAway.Init")
@ConfigProperty(name = "postgresql-operator.password-fingerprint.secret-name")
String secretName;
private final String secretName;

private byte @Nullable [] key;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import io.quarkus.test.junit.QuarkusTest;
import it.aboutbits.postgresql._support.testdata.base.TestUtil;
import it.aboutbits.postgresql._support.testdata.persisted.Given;
import jakarta.inject.Inject;
import lombok.RequiredArgsConstructor;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Readiness;
import org.jspecify.annotations.NullMarked;
Expand All @@ -17,17 +17,15 @@
import static org.assertj.core.api.Assertions.assertThat;

@QuarkusTest
@RequiredArgsConstructor
@NullMarked
class PostgreSQLInstanceReadinessCheckTest {
@Inject
Given given;
private final Given given;

@Inject
@Readiness
PostgreSQLInstanceReadinessCheck readinessCheck;
private final PostgreSQLInstanceReadinessCheck readinessCheck;

@Inject
KubernetesClient kubernetesClient;
private final KubernetesClient kubernetesClient;

@BeforeEach
void resetEnvironment() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@
public class Given {
private final KubernetesClient kubernetesClient;

@SuppressWarnings("NullAway.Init")
@ConfigProperty(name = "quarkus.datasource.devservices.username")
String username;
private final String username;

@SuppressWarnings("NullAway.Init")
@ConfigProperty(name = "quarkus.datasource.devservices.password")
String password;
private final String password;

@SuppressWarnings("NullAway.Init")
@ConfigProperty(name = "quarkus.datasource.jdbc.url")
String jdbcUrl;
private final String jdbcUrl;

DBConnectionDetails dbConnectionDetails() {
return new DBConnectionDetails(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ void clearSecrets() {

/// Each instance has its own key cache, like a fresh operator process.
private static PasswordFingerprintService newService() {
var service = new PasswordFingerprintService(client);
service.secretName = SECRET_NAME;

return service;
return new PasswordFingerprintService(client, SECRET_NAME);
}

@Nested
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import io.quarkus.test.InjectMock;
import io.quarkus.test.junit.QuarkusTest;
import it.aboutbits.postgresql.core.PostgreSQLContextFactory;
import jakarta.inject.Inject;
import lombok.RequiredArgsConstructor;
import org.jooq.CloseableDSLContext;
import org.jooq.exception.DataAccessException;
import org.jspecify.annotations.NullMarked;
Expand All @@ -21,14 +21,14 @@
import static org.mockito.Mockito.when;

@QuarkusTest
@RequiredArgsConstructor
@NullMarked
class ClusterConnectionReconcilerErrorTest {
@SuppressWarnings("NullAway.Init")
@InjectMock
PostgreSQLContextFactory contextFactory;

@Inject
ClusterConnectionReconciler reconciler;
private final ClusterConnectionReconciler reconciler;

private ClusterConnection resource;
private Context<ClusterConnection> context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@ class ClusterConnectionReconcilerTest {

private final KubernetesClient kubernetesClient;

@SuppressWarnings("NullAway.Init")
@ConfigProperty(name = "quarkus.datasource.devservices.username")
String dbUsername;
private final String dbUsername;

@SuppressWarnings("NullAway.Init")
@ConfigProperty(name = "quarkus.datasource.devservices.password")
String dbPassword;
private final String dbPassword;

@BeforeEach
void resetEnvironment() {
Expand Down