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,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