1
0

Refactoring: Paketnamen und Klassennamen

This commit is contained in:
2026-04-02 14:40:14 +02:00
parent 1c53b65b86
commit 60498ab3c8
26 changed files with 111 additions and 105 deletions

View File

@@ -1,14 +1,14 @@
package de.gecheckt.pdf.umbenenner.adapter.inbound.cli;
package de.gecheckt.pdf.umbenenner.adapter.in.cli;
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.domain.model.BatchRunContext;
/**
* CLI command adapter for batch processing scheduling.
* <p>
* This class acts as the inbound technical entry point that exclusively delegates
* to the application layer's batch processing use case via the {@link RunBatchProcessingUseCase}
* to the application layer's batch processing use case via the {@link BatchRunProcessingUseCase}
* interface. It receives the batch run outcome and makes it available to the Bootstrap layer
* for exit code determination and logging.
* <p>
@@ -21,19 +21,19 @@ import de.gecheckt.pdf.umbenenner.domain.model.BatchRunContext;
* enabling run ID and timing tracking throughout the batch cycle.
* <p>
* M2-AP-005 Update: Dependency inversion achieved - this adapter depends only on the
* RunBatchProcessingUseCase interface, not on any concrete implementation. Bootstrap
* BatchRunProcessingUseCase interface, not on any concrete implementation. Bootstrap
* is responsible for injecting the appropriate use case implementation.
*/
public class SchedulerBatchCommand {
private final RunBatchProcessingUseCase useCase;
private final BatchRunProcessingUseCase useCase;
/**
* Creates a new SchedulerBatchCommand with the given use case.
*
* @param useCase the batch processing use case to delegate to
*/
public SchedulerBatchCommand(RunBatchProcessingUseCase useCase) {
public SchedulerBatchCommand(BatchRunProcessingUseCase useCase) {
this.useCase = useCase;
}

View File

@@ -7,16 +7,16 @@
* <p>
* Components:
* <ul>
* <li>{@link de.gecheckt.pdf.umbenenner.adapter.inbound.cli.SchedulerBatchCommand}
* CLI entry point that delegates to RunBatchProcessingUseCase interface (AP-005)</li>
* <li>{@link de.gecheckt.pdf.umbenenner.adapter.in.cli.SchedulerBatchCommand}
* CLI entry point that delegates to BatchRunProcessingUseCase interface (AP-005)</li>
* </ul>
* <p>
* M2-AP-005 Architecture:
* <ul>
* <li>Adapter depends on: {@link de.gecheckt.pdf.umbenenner.application.port.in.RunBatchProcessingUseCase} (interface)</li>
* <li>Adapter depends on: {@link de.gecheckt.pdf.umbenenner.application.port.in.BatchRunProcessingUseCase} (interface)</li>
* <li>Adapter does not depend on: any concrete use case implementation</li>
* <li>Bootstrap wires concrete use case implementation via constructor injection</li>
* <li>Dependency direction: Adapter IN (through port) Application</li>
* </ul>
*/
package de.gecheckt.pdf.umbenenner.adapter.inbound.cli;
package de.gecheckt.pdf.umbenenner.adapter.in.cli;

View File

@@ -1,7 +1,8 @@
package de.gecheckt.pdf.umbenenner.adapter.inbound.cli;
package de.gecheckt.pdf.umbenenner.adapter.in.cli;
import de.gecheckt.pdf.umbenenner.adapter.in.cli.SchedulerBatchCommand;
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.domain.model.BatchRunContext;
import de.gecheckt.pdf.umbenenner.domain.model.RunId;
@@ -21,7 +22,7 @@ class SchedulerBatchCommandTest {
@Test
void constructor_acceptsRunBatchProcessingUseCase() {
RunBatchProcessingUseCase mockUseCase = (context) -> BatchRunOutcome.SUCCESS;
BatchRunProcessingUseCase mockUseCase = (context) -> BatchRunOutcome.SUCCESS;
SchedulerBatchCommand command = new SchedulerBatchCommand(mockUseCase);
@@ -31,7 +32,7 @@ class SchedulerBatchCommandTest {
@Test
void run_delegatesToUseCaseAndReturnsOutcome() {
// Setup: mock use case that returns SUCCESS
RunBatchProcessingUseCase mockUseCase = (context) -> BatchRunOutcome.SUCCESS;
BatchRunProcessingUseCase mockUseCase = (context) -> BatchRunOutcome.SUCCESS;
SchedulerBatchCommand command = new SchedulerBatchCommand(mockUseCase);
BatchRunContext context = new BatchRunContext(new RunId("test-run"), Instant.now());
@@ -65,7 +66,7 @@ class SchedulerBatchCommandTest {
@Test
void run_returnsSuccessOutcome() {
RunBatchProcessingUseCase successUseCase = (context) -> BatchRunOutcome.SUCCESS;
BatchRunProcessingUseCase successUseCase = (context) -> BatchRunOutcome.SUCCESS;
SchedulerBatchCommand command = new SchedulerBatchCommand(successUseCase);
BatchRunContext context = new BatchRunContext(new RunId("test"), Instant.now());
@@ -78,7 +79,7 @@ class SchedulerBatchCommandTest {
@Test
void run_returnsFailureOutcome() {
RunBatchProcessingUseCase failureUseCase = (context) -> BatchRunOutcome.FAILURE;
BatchRunProcessingUseCase failureUseCase = (context) -> BatchRunOutcome.FAILURE;
SchedulerBatchCommand command = new SchedulerBatchCommand(failureUseCase);
BatchRunContext context = new BatchRunContext(new RunId("test"), Instant.now());
@@ -91,7 +92,7 @@ class SchedulerBatchCommandTest {
@Test
void run_returnsLockUnavailableOutcome() {
RunBatchProcessingUseCase lockUnavailableUseCase = (context) -> BatchRunOutcome.LOCK_UNAVAILABLE;
BatchRunProcessingUseCase lockUnavailableUseCase = (context) -> BatchRunOutcome.LOCK_UNAVAILABLE;
SchedulerBatchCommand command = new SchedulerBatchCommand(lockUnavailableUseCase);
BatchRunContext context = new BatchRunContext(new RunId("test"), Instant.now());
@@ -103,7 +104,7 @@ class SchedulerBatchCommandTest {
@Test
void run_multipleCallsWithDifferentContexts() {
RunBatchProcessingUseCase mockUseCase = (context) -> BatchRunOutcome.SUCCESS;
BatchRunProcessingUseCase mockUseCase = (context) -> BatchRunOutcome.SUCCESS;
SchedulerBatchCommand command = new SchedulerBatchCommand(mockUseCase);
BatchRunContext context1 = new BatchRunContext(new RunId("run-1"), Instant.now());
@@ -123,7 +124,7 @@ class SchedulerBatchCommandTest {
RunId runId = new RunId("immutable-test");
Instant startTime = Instant.parse("2026-03-31T20:00:00Z");
RunBatchProcessingUseCase mockUseCase = (context) -> {
BatchRunProcessingUseCase mockUseCase = (context) -> {
// Verify context state is not modified
assertEquals(runId, context.runId());
assertEquals(startTime, context.startInstant());
@@ -142,7 +143,7 @@ class SchedulerBatchCommandTest {
/**
* Mock use case that captures the passed context for verification.
*/
private static class MockCapturingUseCase implements RunBatchProcessingUseCase {
private static class MockCapturingUseCase implements BatchRunProcessingUseCase {
BatchRunContext capturedContext;
@Override