Refactoring: Paketnamen und Klassennamen
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@ import de.gecheckt.pdf.umbenenner.domain.model.BatchRunContext;
|
||||
* <li>The context flows through the entire batch cycle for correlation and logging</li>
|
||||
* </ul>
|
||||
*/
|
||||
public interface RunBatchProcessingUseCase {
|
||||
public interface BatchRunProcessingUseCase {
|
||||
|
||||
/**
|
||||
* Executes the batch processing workflow.
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* <p>
|
||||
* Central inbound port:
|
||||
* <ul>
|
||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.port.in.RunBatchProcessingUseCase}
|
||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.port.in.BatchRunProcessingUseCase}
|
||||
* — The primary use case for executing a complete batch run</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
|
||||
+5
-5
@@ -2,7 +2,7 @@ package de.gecheckt.pdf.umbenenner.application.usecase;
|
||||
|
||||
import de.gecheckt.pdf.umbenenner.application.config.StartConfiguration;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunOutcome;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.in.RunBatchProcessingUseCase;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.in.BatchRunProcessingUseCase;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.PdfTextExtractionPort;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.RunLockPort;
|
||||
import de.gecheckt.pdf.umbenenner.application.port.out.RunLockUnavailableException;
|
||||
@@ -26,7 +26,7 @@ import org.apache.logging.log4j.Logger;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Batch processing implementation of {@link RunBatchProcessingUseCase}.
|
||||
* Batch processing implementation of {@link BatchRunProcessingUseCase}.
|
||||
* <p>
|
||||
* Orchestrates the complete batch processing workflow:
|
||||
* <ol>
|
||||
@@ -53,9 +53,9 @@ import java.util.List;
|
||||
* <li>No cross-run retry logic</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class BatchRunProcessingUseCase implements RunBatchProcessingUseCase {
|
||||
public class DefaultBatchRunProcessingUseCase implements BatchRunProcessingUseCase {
|
||||
|
||||
private static final Logger LOG = LogManager.getLogger(BatchRunProcessingUseCase.class);
|
||||
private static final Logger LOG = LogManager.getLogger(DefaultBatchRunProcessingUseCase.class);
|
||||
|
||||
private final StartConfiguration configuration;
|
||||
private final RunLockPort runLockPort;
|
||||
@@ -74,7 +74,7 @@ public class BatchRunProcessingUseCase implements RunBatchProcessingUseCase {
|
||||
* @param pdfTextExtractionPort for extracting text and page count from a single PDF
|
||||
* @throws NullPointerException if any parameter is null
|
||||
*/
|
||||
public BatchRunProcessingUseCase(
|
||||
public DefaultBatchRunProcessingUseCase(
|
||||
StartConfiguration configuration,
|
||||
RunLockPort runLockPort,
|
||||
SourceDocumentCandidatesPort sourceDocumentCandidatesPort,
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
* <ul>
|
||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.usecase.NoOpRunBatchProcessingUseCase}
|
||||
* — Minimal no-op for technical validation without start protection</li>
|
||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.usecase.BatchRunProcessingUseCase}
|
||||
* <li>{@link de.gecheckt.pdf.umbenenner.application.usecase.DefaultBatchRunProcessingUseCase}
|
||||
* — Production implementation with run lock and controlled batch cycle</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
|
||||
+14
-14
@@ -31,7 +31,7 @@ import java.util.Map;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
* Tests for {@link BatchRunProcessingUseCase}.
|
||||
* Tests for {@link DefaultBatchRunProcessingUseCase}.
|
||||
* <p>
|
||||
* Covers:
|
||||
* <ul>
|
||||
@@ -57,7 +57,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
MockRunLockPort lockPort = new MockRunLockPort();
|
||||
StartConfiguration config = buildConfig(tempDir);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, new EmptyCandidatesPort(), new NoOpExtractionPort());
|
||||
BatchRunContext context = new BatchRunContext(new RunId("test-run-1"), Instant.now());
|
||||
|
||||
@@ -73,7 +73,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
CountingRunLockPort lockPort = new CountingRunLockPort(true);
|
||||
StartConfiguration config = buildConfig(tempDir);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, new EmptyCandidatesPort(), new NoOpExtractionPort());
|
||||
BatchRunContext context = new BatchRunContext(new RunId("test-run-2"), Instant.now());
|
||||
|
||||
@@ -92,7 +92,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
CountingRunLockPort lockPort = new CountingRunLockPort(true);
|
||||
StartConfiguration config = buildConfig(tempDir);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, new EmptyCandidatesPort(), new NoOpExtractionPort());
|
||||
BatchRunContext context = new BatchRunContext(new RunId("test-run-f1"), Instant.now());
|
||||
|
||||
@@ -108,7 +108,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
ErrorAfterAcquireLockPort lockPort = new ErrorAfterAcquireLockPort();
|
||||
StartConfiguration config = buildConfig(tempDir);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, new EmptyCandidatesPort(), new NoOpExtractionPort());
|
||||
BatchRunContext context = new BatchRunContext(new RunId("test-run-3"), Instant.now());
|
||||
|
||||
@@ -128,7 +128,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
MockRunLockPort lockPort = new MockRunLockPort();
|
||||
StartConfiguration config = buildConfig(tempDir);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, new EmptyCandidatesPort(), new NoOpExtractionPort());
|
||||
BatchRunContext context = new BatchRunContext(new RunId("empty"), Instant.now());
|
||||
|
||||
@@ -148,7 +148,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
FixedCandidatesPort candidatesPort = new FixedCandidatesPort(List.of(candidate));
|
||||
FixedExtractionPort extractionPort = new FixedExtractionPort(success);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("happy"), Instant.now());
|
||||
|
||||
@@ -170,7 +170,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
FixedCandidatesPort candidatesPort = new FixedCandidatesPort(List.of(candidate));
|
||||
FixedExtractionPort extractionPort = new FixedExtractionPort(emptySuccess);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("no-text"), Instant.now());
|
||||
|
||||
@@ -191,7 +191,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
FixedCandidatesPort candidatesPort = new FixedCandidatesPort(List.of(candidate));
|
||||
FixedExtractionPort extractionPort = new FixedExtractionPort(manyPages);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("page-limit"), Instant.now());
|
||||
|
||||
@@ -211,7 +211,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
FixedCandidatesPort candidatesPort = new FixedCandidatesPort(List.of(candidate));
|
||||
FixedExtractionPort extractionPort = new FixedExtractionPort(contentError);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("content-error"), Instant.now());
|
||||
|
||||
@@ -230,7 +230,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
FixedCandidatesPort candidatesPort = new FixedCandidatesPort(List.of(candidate));
|
||||
FixedExtractionPort extractionPort = new FixedExtractionPort(technicalError);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("tech-error"), Instant.now());
|
||||
|
||||
@@ -248,7 +248,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
throw new SourceDocumentAccessException("Source folder not readable");
|
||||
};
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, failingPort, new NoOpExtractionPort());
|
||||
BatchRunContext context = new BatchRunContext(new RunId("access-fail"), Instant.now());
|
||||
|
||||
@@ -287,7 +287,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
.with(technicalErrorCandidate, new PdfExtractionTechnicalError("I/O error", null))
|
||||
.with(contentErrorCandidate, new PdfExtractionContentError("PDF is encrypted"));
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("mixed"), Instant.now());
|
||||
|
||||
@@ -313,7 +313,7 @@ class BatchRunProcessingUseCaseTest {
|
||||
FixedCandidatesPort candidatesPort = new FixedCandidatesPort(candidates);
|
||||
FixedExtractionPort extractionPort = new FixedExtractionPort(success);
|
||||
|
||||
BatchRunProcessingUseCase useCase = new BatchRunProcessingUseCase(
|
||||
DefaultBatchRunProcessingUseCase useCase = new DefaultBatchRunProcessingUseCase(
|
||||
config, lockPort, candidatesPort, extractionPort);
|
||||
BatchRunContext context = new BatchRunContext(new RunId("multi"), Instant.now());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user