diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultMigrationManager.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultMigrationManager.java index e64bcf66..d4cae5cd 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultMigrationManager.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultMigrationManager.java @@ -1,5 +1,6 @@ package com.gruelbox.transactionoutbox; +import jakarta.validation.constraints.NotNull; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; @@ -7,8 +8,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; - -import jakarta.validation.constraints.NotNull; import lombok.AllArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultPersistor.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultPersistor.java index a0a1a091..3f90bea7 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultPersistor.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DefaultPersistor.java @@ -1,5 +1,6 @@ package com.gruelbox.transactionoutbox; +import jakarta.validation.constraints.NotNull; import java.io.IOException; import java.io.Reader; import java.io.StringWriter; @@ -13,8 +14,6 @@ import java.time.Instant; import java.util.ArrayList; import java.util.List; - -import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.AllArgsConstructor; import lombok.Builder; diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DriverConnectionProvider.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DriverConnectionProvider.java index b4861960..896fb510 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DriverConnectionProvider.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/DriverConnectionProvider.java @@ -2,10 +2,9 @@ import static com.gruelbox.transactionoutbox.Utils.uncheckedly; +import jakarta.validation.constraints.NotBlank; import java.sql.Connection; import java.sql.DriverManager; - -import jakarta.validation.constraints.NotBlank; import lombok.experimental.SuperBuilder; import lombok.extern.slf4j.Slf4j; @@ -28,8 +27,7 @@ @Slf4j final class DriverConnectionProvider implements ConnectionProvider { - @NotBlank - private final String driverClassName; + @NotBlank private final String driverClassName; @NotBlank private final String url; diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/ExecutorSubmitter.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/ExecutorSubmitter.java index 0eb9ba09..dcba184d 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/ExecutorSubmitter.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/ExecutorSubmitter.java @@ -1,11 +1,10 @@ package com.gruelbox.transactionoutbox; +import jakarta.validation.constraints.NotNull; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.Executor; import java.util.concurrent.RejectedExecutionException; import java.util.function.Consumer; - -import jakarta.validation.constraints.NotNull; import lombok.Builder; import lombok.extern.slf4j.Slf4j; import org.slf4j.event.Level; diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutbox.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutbox.java index 26677070..dacbf029 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutbox.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutbox.java @@ -1,10 +1,9 @@ package com.gruelbox.transactionoutbox; +import jakarta.validation.ClockProvider; import java.time.Clock; import java.time.Duration; import java.util.concurrent.Executor; - -import jakarta.validation.ClockProvider; import lombok.ToString; import org.slf4j.MDC; import org.slf4j.event.Level; diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxEntry.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxEntry.java index 4440d6f3..4e2c98f7 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxEntry.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxEntry.java @@ -2,12 +2,11 @@ import static java.util.stream.Collectors.joining; -import java.time.Instant; -import java.util.Arrays; - import jakarta.validation.constraints.Future; import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.PositiveOrZero; +import java.time.Instant; +import java.util.Arrays; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxImpl.java b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxImpl.java index 6cdd1638..ed01e433 100644 --- a/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxImpl.java +++ b/transactionoutbox-core/src/main/java/com/gruelbox/transactionoutbox/TransactionOutboxImpl.java @@ -5,6 +5,10 @@ import static java.time.temporal.ChronoUnit.MILLIS; import static java.time.temporal.ChronoUnit.MINUTES; +import jakarta.validation.ClockProvider; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Min; +import jakarta.validation.constraints.NotNull; import java.lang.reflect.InvocationTargetException; import java.time.Duration; import java.time.Instant; @@ -12,11 +16,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; - -import jakarta.validation.ClockProvider; -import jakarta.validation.Valid; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotNull; import lombok.ToString; import lombok.extern.slf4j.Slf4j; import org.hibernate.validator.constraints.Length; @@ -29,10 +28,8 @@ class TransactionOutboxImpl implements TransactionOutbox { private static final int DEFAULT_FLUSH_BATCH_SIZE = 4096; - @NotNull - private final TransactionManager transactionManager; - @Valid - @NotNull private final Persistor persistor; + @NotNull private final TransactionManager transactionManager; + @Valid @NotNull private final Persistor persistor; @Valid @NotNull private final Instantiator instantiator; @NotNull private final Submitter submitter; @NotNull private final Duration attemptFrequency; diff --git a/transactionoutbox-core/src/test/java/com/gruelbox/transactionoutbox/TestValidator.java b/transactionoutbox-core/src/test/java/com/gruelbox/transactionoutbox/TestValidator.java index 05ddf708..37ffe492 100644 --- a/transactionoutbox-core/src/test/java/com/gruelbox/transactionoutbox/TestValidator.java +++ b/transactionoutbox-core/src/test/java/com/gruelbox/transactionoutbox/TestValidator.java @@ -3,12 +3,11 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; +import jakarta.validation.ValidationException; import java.math.BigDecimal; import java.time.Clock; import java.time.Instant; import java.time.ZoneId; - -import jakarta.validation.ValidationException; import org.junit.jupiter.api.Test; class TestValidator {